打印本文 打印本文 关闭窗口 关闭窗口
VB打造超酷个性化菜单(三)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数9898  更新时间:2009/4/23 15:44:34  文章录入:mintao  责任编辑:mintao
bsp;           If MyItemInfo(.itemID).itemIcon <> 0 Then

                                        DrawEdge .hdc, iconRect, BDR_RAISEDINNER, BF_RECT

                                    End If

                                Case IIS_SHADOW                                             '''' 阴影

                                    hBrush = CreateSolidBrush(RGB(128, 128, 128))

                                    DrawState .hdc, hBrush, 0, MyItemInfo(.itemID).itemIcon, 0, iconRect.Left + 3, iconRect.Top + (iconRect.Bottom - iconRect.Top + 1 - 16) / 2 + 1, 0, 0, DST_ICON Or DSS_MONO

                                    DeleteObject hBrush

                                    DrawIconEx .hdc, iconRect.Left + 1, iconRect.Top + (iconRect.Bottom - iconRect.Top + 1 - 16) / 2 - 1, MyItemInfo(.itemID).itemIcon, 16, 16, 0, 0, DI_NORMAL

                            End Select

                        Else

                            '''' CHECKBOX型菜单项图标效果

                            If MyItemInfo(.itemID).itemState And MIS_CHECKED Then

                                DrawIconEx .hdc, iconRect.Left + 2, iconRect.Top + (iconRect.Bottom - iconRect.Top + 1 - 16) / 2, MyItemInfo(.itemID).itemIcon, 16, 16, 0, 0, DI_NORMAL

                            End If

                        End If

                   

                    Else                                                        '''' 当鼠标移开菜单项时

                       

                        '''' 画菜单项边框和背景(清除)

                        If BarStyle <> LBS_NONE Then

                            itemRect.Left = barRect.Right + 1

                        Else

                            itemRect.Left = 0

                        End If

                        hBrush = CreateSolidBrush(BkColor)

                        FillRect .hdc, itemRect, hBrush

                        DeleteObject hBrush

                       

                       

                        '''' 画菜单项文字

                        SetTextColor .hdc, TextEnabledColor

                        DrawText .hdc, MyItemInfo(.itemID).itemText, -1, textRect, DT_SINGLELINE Or DT_LEFT Or DT_VCENTER

                       

                        

    

 << 上一页  [11] [12] [13] [14] [15] [16]  下一页

打印本文 打印本文 关闭窗口 关闭窗口