通行证: 用户 密码
http://www.pconline.cn/
汽车网 | 游戏网 | 时尚女性
分站:北京 上海 广州 深圳 香港
广西 重庆 山东 江苏 辽宁 福建
首 页 | 今日报价 | 新闻中心 | 数码世界 | 硬件资讯 | 软件资讯 | 下 载 | 游 戏 |
论 坛 | 产 品 库 | 渠道商情 | 招聘培训 | 二    手 | 评 测 室 | 导 购 | 社 区 |
摄影
部落
手 机
数码相机
随身听
 DIY配件
笔记本
 台式机
摄像机
精品廊
-
您现在的位置:软件资讯 > 开发特区 > 开发语言 > VB
  VB打造超酷个性化菜单(2) 出处:CSDN
[ 2005-05-16 15:29:13 ] 作者:goodname008 责任编辑:xietaoming
-

' 设置菜单项状态
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



[上一页] [1] [2] [3] [下一页]

正在加载评论,请稍候…

ad
发给好友 我要报错 投稿给我们 加入收藏 返回顶部

本栏今日更新
相关文章
·WinXP SE不支持P4/Athlon CPU
·修复多项错误,Nero 6新版出炉
·Windows OneCare更多细节披露
·令人期待!珊瑚虫QQ 4.0支持显隐身
·妙手生花:赶走文本中的"小黑子"
·一网打尽:批量下载百度MP3歌曲
·浏览器和资源管理器相结合的FTP工具
·QQ等级另类升级方法
·VB打造超酷个性化菜单(1)
·VB.NET多线程开发实例
·仅用一条指令实现界面换肤和多语言版本
·VB游戏攻略-平面魔方游戏
·Swish打造“仿韩国弹性菜单”
·如何编写高质量的VB代码(1)
·用VB控制EXCEL生成报表
·VB和C#中常用数据类型对应表

完美时尚娱乐:2004年腾讯QQ评测大观
精彩无限:MSN Shell4使用指南
亲手制作鲜花情人贺卡送给她
挑战伏明霞?企鹅跳水游戏,看你能得多少分?

新闻搜索
高级搜索
Flash排行榜
·《老鼠爱大米》黑白版
·Take Me To Your Heart
·超好玩小游戏!淘金者
·当你孤单你会想起谁
·别说我的眼泪你无所谓
·下辈子如果我还记得你
·飞儿乐队:我们的爱
·酸酸甜甜就是我
·等你说爱我-如果有一天
·大学自习室继-就说
热点专题
·全面了解FireFox浏览器
·"麦"进新时代:QQ玩超级语音
·妙手解决多媒体播放的痼疾
·Tom-Skype:分享语聊新体验
·回味:04年软件"开门七件事"
·04年软件八大热点精彩回眸
·欢乐Flash带你畅游圣诞
·优化:打造更好用的WinXP
·十大超人气趣味小游戏
·最受关注补丁SP2横空出世
·寻觅流行IM最爱大决战!
·04十大最动人心扉的情感MV
IT培训十大热门文章
-