Office-like menu...
-
can we add icon to mainmenu control in windows form? how? thanks. is there a sub or function like "mainmenu.items(x).icon=(filename)... :laugh:"
-
can we add icon to mainmenu control in windows form? how? thanks. is there a sub or function like "mainmenu.items(x).icon=(filename)... :laugh:"
-
can we add icon to mainmenu control in windows form? how? thanks. is there a sub or function like "mainmenu.items(x).icon=(filename)... :laugh:"
i dont know about VB.NET.But in VB6 you need to use this API function:
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
This is how you use it in VB6_Get the handle of the form's menu hMenu = GetMenu(Me.hWnd) 'Get the handle of the form's submenu hSubMenu = GetSubMenu(hMenu, 0) 'Change first item (index=0) picBitmaps(0).Picture = picBitmaps(0).Image lngID = GetMenuItemID(hSubMenu, 0) Call ModifyMenu(hMenu, lngID, MF_BITMAP, lngID, CLng(picBitmaps(0).Picture))_
i heard VB.NET has some API inbuilt.So look it up OK! hope i helped Gideon:laugh: -
When you sy main menu, are you referring to a menustrip that you have placed on the form. Posted by The ANZAC
yes, i am.. i dont know how to add icon to it.
-
i dont know about VB.NET.But in VB6 you need to use this API function:
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
This is how you use it in VB6_Get the handle of the form's menu hMenu = GetMenu(Me.hWnd) 'Get the handle of the form's submenu hSubMenu = GetSubMenu(hMenu, 0) 'Change first item (index=0) picBitmaps(0).Picture = picBitmaps(0).Image lngID = GetMenuItemID(hSubMenu, 0) Call ModifyMenu(hMenu, lngID, MF_BITMAP, lngID, CLng(picBitmaps(0).Picture))_
i heard VB.NET has some API inbuilt.So look it up OK! hope i helped Gideon:laugh:ok, i will try it out, thankz for the info.. ;) Ghost