处理 SSI 文件时出错
Visual Basic
没有任何子栏目
您现在的位置: IT文谷 >> 编程语言 >> Visual Basic >> 文章正文
VB打造超酷个性化菜单(三)VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)
VB打造超酷个性化菜单(三)
VB打造超酷个性化菜单(三)VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)
处理 SSI 文件时出错
VB打造超酷个性化菜单(三)VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)

VB打造超酷个性化菜单(三)

 

(接上篇)

 

' 设置菜单项状态

Public Sub SetItemState(ByVal itemAlias As String, ByVal itemState As MenuItemState)

    Dim i As Long

    For i = 0 To UBound(MyItemInfo)

        If MyItemInfo(i).itemAlias = itemAlias Then

            MyItemInfo(i).itemState = itemState

            Dim ItemInfo As MENUITEMINFO

            With ItemInfo

                .cbSize = Len(ItemInfo)

                .fMask = MIIM_STRING Or MIIM_FTYPE Or MIIM_STATE Or MIIM_SUBMENU Or MIIM_ID Or MIIM_DATA

            End With

            GetMenuItemInfo hMenu, i, False, ItemInfo

            With ItemInfo

                .fState = .fState Or itemState

            End With

            SetMenuItemInfo hMenu, i, False, ItemInfo

            Exit For

        End If

    Next i

End Sub

 

' 获得菜单项状态

Public Function GetItemState(ByVal itemAlias As String) As MenuItemState

    Dim i As Long

    For i = 0 To UBound(MyItemInfo)

        If MyItemInfo(i).itemAlias = itemAlias Then

            GetItemState = MyItemInfo(i).itemState

            Exit For

        End If

    Next i

End Function

 

' 属性: 菜单句柄

Public Property Get hwnd() As Long

    hwnd = hMenu

End Property

 

Public Property Let hwnd(ByVal nValue As Long)

 

End Property

 

' 属性: 菜单附加条宽度

Public Property Get LeftBarWidth() As Long

    LeftBarWidth = BarWidth

End Property

 

Public Property Let LeftBarWidth(ByVal nBarWidth As Long)

    If nBarWidth >= 0 Then

        BarWidth = nBarWidth

    End If

End Property

 

' 属性: 菜单附加条风格

Public Property Get LeftBarStyle() As MenuLeftBarStyle

    LeftBarStyle = BarStyle

End Property

 

Public Property Let LeftBarStyle(ByVal nBarStyle As MenuLeftBarStyle)

    If nBarStyle >= 0 And nBarStyle <= 4 Then

        BarStyle = nBarStyle

    End If

End Property

 

' 属性: 菜单附加条图像(只有当 LeftBarStyle 设置为 LBS_IMAGE 时才有效)

Public Property Get LeftBarImage() As StdPicture

    Set LeftBarImage = BarImage

End Property

 

Public Property Let LeftBarImage(ByVal nBarImage As StdPicture)

    Set BarImage = nBarImage

End Property

 

' 属性: 菜单附加条过渡色起始颜色(只有当 LeftBarStyle 设置为 LBS_HORIZONTALCOLOR 或 LBS_VERTICALCOLOR 时才有效)

'       当 LeftBarStyle 设置为 LBS_SOLIDCOLOR (实色填充)时以 LeftBarStartColor 颜色为准

Public Property Get LeftBarStartColor() As Long

    LeftBarStartColor = BarStartColor

End Property

 

Public Property Let LeftBarStartColor(ByVal nBarStartColor As Long)

    BarStartColor = nBarStartColor

End Property

 

' 属性: 菜单附加条过渡色终止颜色(只有当 LeftBarStyle 设置为 LBS_HORIZONTALCOLOR 或 LBS_VERTICALCOLOR 时才有效)

'       当 LeftBarStyle 设置为 LBS_SOLIDCOLOR (实色填充)时以 LeftBarStartColor 颜色为准

Public Property Get LeftBarEndColor() As Long

    LeftBarEndColor = BarEndColor

End Property

 

Public Property Let LeftBarEndColor(ByVal nBarEndColor As Long)

    BarEndColor = nBarEndColor

End Property

 

' 属性: 菜单项高亮条的范围

Public Property Get ItemSelectScope() As MenuItemSelectScope

    ItemSelectScope = SelectScope

End Property

 

Public Property Let ItemSelectScope(ByVal nSelectScope As MenuItemSelectScope)

    SelectScope = nSelectScope

End Property

 

' 属性: 菜单项可用时文字颜色

Public Property Get ItemTextEnabledColor() As Long

    ItemTextEnabledColor = TextEnabledColor

End Property

 

Public Property Let ItemTextEnabledColor(ByVal nTextEnabledColor As Long)

    TextEnabledColor = nTextEnabledColor

End Property

 

' 属性: 菜单项不可用时文字颜色

Public Property Get ItemTextDisabledColor() As Long

    ItemTextDisabledColor = TextDisabledColor

End Property

 

Public Property Let ItemTextDisabledColor(ByVal nTextDisabledColor As Long)

    TextDisabledColor = nTextDisabledColor

End Property

 

' 属性: 菜单项选中时文字颜色

Public Property Get ItemTextSelectColor() As Long

    ItemTextSelectColor = TextSelectColor

End Property

 

Public Property Let ItemTextSelectColor(ByVal nTextSelectColor As Long)

    TextSelectColor = nTextSelectColor

End Property

 

' 属性: 菜单项图标风格

Public Property Get ItemIconStyle() As MenuItemIconStyle

    ItemIconStyle = IconStyle

End Property

 

Public Property Let ItemIconStyle(ByVal nIconStyle As MenuItemIconStyle)

    IconStyle = nIconStyle

End Property

 

' 属性: 菜单项边框风格

Public Property Get ItemSelectEdgeStyle() As MenuItemSelectEdgeStyle

    ItemSelectEdgeStyle = EdgeStyle

End Property

 

Public Property Let ItemSelectEdgeStyle(ByVal nEdgeStyle As MenuItemSelectEdgeStyle)

    EdgeStyle = nEdgeStyle

End Property

 

' 属性: 菜单项边框颜色

Public Property Get ItemSelectEdgeColor() As Long

    ItemSelectEdgeColor = EdgeColor

End Property

 

Public Property Let ItemSelectEdgeColor(ByVal nEdgeColor As Long)

    EdgeColor = nEdgeColor

End Property

 

' 属性: 菜单项背景填充风格

Public Property Get ItemSelectFillStyle() As MenuItemSelectFillStyle

    ItemSelectFillStyle = FillStyle

End Property

 

Public Property Let ItemSelectFillStyle(ByVal nFillStyle As MenuItemSelectFillStyle)

    FillStyle = nFillStyle

End Property

 

' 属性: 菜单项过渡色起始颜色(只有当 ItemSelectFillStyle 设置为 ISFS_HORIZONTALCOLOR 或 ISFS_VERTICALCOLOR 时才有效)

'       当 ItemSelectFillStyle 设置为 ISFS_SOLIDCOLOR (实色填充)时以 ItemSelectFillStartColor 颜色为准

Public Property Get ItemSelectFillStartColor() As Long

    ItemSelectFillStartColor = FillStartColor

End Property

 

Public Property Let ItemSelectFillStartColor(ByVal nFillStartColor As Long)

    FillStartColor = nFillStartColor

End Property

 

' 属性: 菜单项过渡色终止颜色(只有当 ItemSelectFillStyle 设置为 ISFS_HORIZONTALCOLOR 或 ISFS_VERTICALCOLOR 时才有效)

'       当 ItemSelectFillStyle 设置为 ISFS_SOLIDCOLOR (实色填充)时以 ItemSelectFillStartColor 颜色为准

Public Property Get ItemSelectFillEndColor() As Long

    ItemSelectFillEndColor = FillEndColor

End Property

 

Public Property Let ItemSelectFillEndColor(ByVal nFillEndColor As Long)

    FillEndColor = nFillEndColor

End Property

 

' 属性: 菜单背景颜色

Public Property Get BackColor() As Long

    BackColor = BkColor

End Property

 

Public Property Let BackColor(ByVal nBkColor As Long)

    BkColor = nBkColor

End Property

 

' 属性: 菜单分隔条风格

Public Property Get SeparatorStyle() As MenuSeparatorStyle

    SeparatorStyle = SepStyle

End Property

 

Public Property Let SeparatorStyle(ByVal nSepStyle As MenuSeparatorStyle)

    SepStyle = nSepStyle

End Property

 

' 属性: 菜单分隔条颜色

Public Property Get SeparatorColor() As Long

    SeparatorColor = SepColor

End Property

 

Public Property Let SeparatorColor(ByVal nSepColor As Long)

    SepColor = nSepColor

End Property

 

(待续)

 

相关链接:

VB打造超酷个性化菜单(一)

VB打造超酷个性化菜单(二)

VB打造超酷个性化菜单(三)

VB打造超酷个性化菜单(四)

VB打造超酷个性化菜单(五)

VB打造超酷个性化菜单(六)

VB打造超酷个性化菜单(三)VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)
处理 SSI 文件时出错
  • 上一篇文章:

  • 下一篇文章:
  • 进入论坛讨论

    相关文章
    从Windows资源管理器中拖动文件
    一个简单的MP3播放器
    最近刚写的程序!专门解决你的vb程序文件多的问题!
    Visual Basic 安装程序的制作!!
    对《VB程序实现WindowsXP效果的界面》一文的补遗
    VB程序实现WindowsXP效果的界面!!
    平铺与拉伸MDI窗口的背景图 ~!~
    VB打造超酷个性化菜单(六)
    VB打造超酷个性化菜单(五)
    大数阶乘的计算(六)
    VB打造超酷个性化菜单(四)
    VB打造超酷个性化菜单(二)
    热门文章最新推荐

    版权与免责声明:
    ① 本网转载其他媒体稿件是为传播更多的信息,此类稿件不代表本网观点,版权归原作者所有,本网不承担此类稿件侵权行为的连带责任。
    ② 本站原创文章,转载时请注明出自文谷及作者姓名
    ③在本网BBS上发表言论者,文责自负。
    ④如您因版权等问题需要与本网联络,请在30日内联系 。
    VB打造超酷个性化菜单(三)VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)
    VB打造超酷个性化菜单(三)VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)2006-10-28 8:23:12VB打造超酷个性化菜单(三)

    全站热点
    最新推荐
    处理 SSI 文件时出错
    处理 SSI 文件时出错