打印本文 打印本文 关闭窗口 关闭窗口
VB打造超酷个性化菜单(六)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4905  更新时间:2009/4/23 16:37:47  文章录入:mintao  责任编辑:mintao
;               Call LineTo(.hdc, itemRect.Right, i)
                                    Call DeleteObject(hPen)
                                Next i
                               
                            Case ISFS_SOLIDCOLOR                            '''' 实色填充
                               
                                hPen = CreatePen(PS_SOLID, 0, FillStartColor)
                                hBrush = CreateSolidBrush(FillStartColor)
                                SelectObject .hdc, hPen
                                SelectObject .hdc, hBrush
                                Rectangle .hdc, itemRect.Left, itemRect.Top, itemRect.Right, itemRect.Bottom
                                DeleteObject hPen
                                DeleteObject hBrush
                       
                        End Select
                       
                       
                        '''' 画菜单项文字
                        SetTextColor .hdc, TextSelectColor
                        DrawText .hdc, MyItemInfo(.itemID).itemText, -1, textRect, DT_SINGLELINE Or DT_LEFT Or DT_VCENTER
                       
                       
                        '''' 画菜单项图标
                        If MyItemInfo(.itemID).itemType <> MIT_CHECKBOX Then
                            DrawIconEx .hdc, iconRect.Left + 2, iconRect.Top + (iconRect.Bottom - iconRect.Top + 1 - 16) / 2, MyItemInfo(.itemID).itemIcon, 16, 16, 0, 0, DI_NORMAL
                            Select Case IconStyle
                                Case IIS_NONE                                               '''' 无效果
                               
                                Case IIS_SUNKEN                                             '''' 凹进
                                    If MyItemInfo(.itemID).itemIcon <> 0 Then
                                        DrawEdge .hdc, iconRect, BDR_SUNKENOUTER, BF_RECT
                                    End If
                                Case IIS_RAISED                                             '''' 凸起
                                    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

上一页  [1] [2] [3] [4] [5] [6] [7]  下一页

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