Hi, I need to know if there is a way to put an icon next to a menu option you create in vb's menu editor. So if I click on my program's file menu it will give me a drop-down with all the options an beside each option an icon.
Is there a way to do this or am I mad to do something like this???
Yes, its quite simple to put an icon next to a menu item.
Here is but one of many many examples.
VB Code:
'Download the full source+pictures+.. at [url]http://www.allapi.net/php/dlman/dm.cgi?id=bitmenu.zip&action=download[/url]
Private Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) 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
I was having the same problem last week and finally got it licked. When I used one example I would have an image but not text. I finally found something that worked so that the image would be there along with the text. It would only use bitmaps though. Icons didn't work for some reason.
Anyway, now I can't find what I did with it. I spent the better part of today wiping out a virus and I think I lost that page. When I find it again, if you still don't have an answer I'll post it here for you.
I had to download the code again. I just checked it out and it is the code that has both bitmaps and text in the menu. I got it from www.vbcode.com. The zip file is attached intact as it was downloaded.