hi! how can i put a bmp/icon image on my menu? (just like in icq)
thanks.
- i'm using VB 6.0 enterprise edition
Printable View
hi! how can i put a bmp/icon image on my menu? (just like in icq)
thanks.
- i'm using VB 6.0 enterprise edition
Here's a quick example, add a menu and a picturebox (containing the image you want to appear in the menu) to a form:Code:Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Sub Command1_Click()
Dim lMenu As Long
Dim lMenuID As Long
'Get the Menu Handle of the Form
lMenu = GetMenu(Form1.hwnd)
'Get the Menu Handle of the first SubMenu
lMenu = GetSubMenu(lMenu, 0)
'Add the bitmap to the First Item (Zero), in the SubMenu
SetMenuItemBitmaps lMenu, 0, MF_BYPOSITION, Picture1.Picture, Picture1.Picture
End Sub
Logginto http://www.vbaccelerator.com and download their menu control, also you will need the ssubtmr.dll from their site. Just a thought.:)
Or make your own Owner-Drawn menus.
(The hardest way of them all, but also the flashiest)
This was obviously the route I took.
I can give you some source code, but that VBaccelerator thing is probably best.
Thanks Aaron for the code. I tried it and it did work.
I'll try to checkout the site Jethro. I'm sure I can get some usefull codes :)
V(ery) Basic, I'll appreciate it if u'll send me some of ur code. can u mail it to [email protected]?
Thanks a lot guys!