欢迎光临
我们一直在努力

vb给菜单加上图片_visualbasic教程

建站超值云服务器,限时71元/月

PrivateDeclareFunctionGetMenuLib”user32″(ByValhwndAsLong)AsLong

PrivateDeclareFunctionGetSubMenuLib”user32″(ByValhMenuAsLong,ByValnPosAsLong)AsLong

PrivateDeclareFunctionGetMenuItemIDLib”user32″(ByValhMenuAsLong,ByValnPosAsLong)AsLong

PrivateDeclareFunctionSetMenuItemBitmapsLib”user32″_
(ByValhMenuAsLong,ByValnPositionAsLong,_
ByValwFlagsAsLong,ByValhBitmapUncheckedAsLong,_
ByValhBitmapCheckedAsLong)AsLong

PrivateConstMF_BITMAP=&H4&
PrivateTypeMENUITEMINFO
cbSizeAsLong
fMaskAsLong
fTypeAsLong
fStateAsLong
wIDAsLong
hSubMenuAsLong
hbmpCheckedAsLong
hbmpUncheckedAsLong
dwItemDataAsLong
dwTypeDataAsString
cchAsLong
EndType

PrivateDeclareFunctionGetMenuItemCountLib”user32″_
(ByValhMenuAsLong)AsLong

PrivateDeclareFunctionGetMenuItemInfoLib”user32″_
Alias”GetMenuItemInfoA”(ByValhMenuAsLong,_
ByValunAsLong,ByValbAsBoolean,_
lpMenuItemInfoAsMENUITEMINFO)AsBoolean

PrivateConstMIIM_ID=&H2
PrivateConstMIIM_TYPE=&H10
PrivateConstMFT_STRING=&H0&

PrivateSubcmdPicMenu_Click()
DimlngMenuHwndAsLong
DimlngSubHwndAsLong
DimlngMenuIDAsLong

//Retrievethemenuhandle
lngMenuHwnd=GetMenu(Me.hwnd)

//Getthehandleofthefirstsubmenuitem
lngSubHwnd=GetSubMenu(lngMenuHwnd,0)

//Getthemenuidofthefirstbitmpa
lngMenuID=GetMenuItemID(hSubMenu&,0)

//Addthebitmaptothemenuitem
SetMenuItemBitmapslngMenuHwnd,lngMenuID,MF_BITMAP,_
Picture1.Picture,_
Picture1.Picture

EndSub->

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » vb给菜单加上图片_visualbasic教程
分享到: 更多 (0)