Hi ppl,
Does anyone know how you add icons in the menus like in Microsoft office or any sites that I can go to to get sample code example on how to do this.
Cheers
AD
Printable View
Hi ppl,
Does anyone know how you add icons in the menus like in Microsoft office or any sites that I can go to to get sample code example on how to do this.
Cheers
AD
Try:
You can also search for examples on Planet Source CodeCode: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 GetMenuItemID 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
Const MF_BITMAP = &H4&
Private Sub Command1_Click()
Dim hMenu As Long, hSub As Long, ItemID As Long
hMenu = GetMenu(Me.hwnd)
hSub = GetSubMenu(hMenu, 0)
ItemID = GetMenuItemID(hSub, 0)
SetMenuItemBitmaps hMenu, ItemID, MF_BITMAP, Picture1, Picture1
End Sub
'I'm not sure who's code it is, but i belive i've seen Magatron post it.
Gl,
D!m
[Edited by Dim on 09-13-2000 at 01:44 AM]
(a la Phoebe)
Ooh. Ooh. Ooh
I've made somthing perfect for this, unless you are going to need submenus.
I'll e-mail it to you whether you like it or not ;) ...
Well. Actually I can't e-mail it to you since you don't seem to have an e-mail :rolleyes:
That's a real pity.
I thought I'd get to send it to somebody else. :(
Anyhow, I think that there is something
hyah
But if it is the exaple I think it is, mine is a whole world better.
(Not showing off or anything ;) )
Thank for the help dudes.
Okay here's my email [email protected] and don't mail me any sick stuff or porn.
I havent been on the net for a few day cause I got the flu and I been taking echinacea before I got sick. What a crock I still got sick that herbal remedy is a fake!!
VBThunder has a very good example for OFFICE-STYLE popup menus that rule. You could use that way, but it really supports only 10x10 graphics.
___________________
Goto: http://www.vbthunder.com/
D!m: Yes I'm pretty sure that was me. I think the bitmap has to be 13x13 in order for it to fit.
Well I rule on menus, so I'l send ya that popup menu example ;)
It supports enablng/disabling boldening, italicising, underlining, submenus and different background colours.
I'd really like your menu demo also .
[email protected] if you would be so kind .
Thanks
[]Private[]
vbaccelerator (www.vbaccelerator.com) has an ace dll thng for putting pics menus, and creating them at runtime etc. Well worth a look (like the rest of his site)
- gaffa
Thanks V(ery) Basic. He's right, he does definitely rule
Having so much fun..