vb 6.0 怎样自己写菜单
来源:百度知道 编辑:UC知道 时间:2024/06/06 01:49:23
'可以使用VB的API函数
Option Explicit
Private Const MF_POPUP = &H10&
Private Const MF_STRING = &H0&
Private Const MF_SEPARATOR = &H800&
Private Const MF_BYPOSITION = &H400&
Private Declare Function CreateMenu Lib "user32" () As Long
Private Declare Function CreatePopupMenu Lib "user32" () As Long
Private Declare Function InsertMenu Lib "user32" Alias "InsertMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
Private Declare Function SetMenu Lib "user32" (ByVal hwnd As Long, ByVal hMenu As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (