PDA

Click to See Complete Forum and Search --> : Icon in Menu


Apocalypse Dude
Sep 13th, 2000, 12:27 AM
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

Dim
Sep 13th, 2000, 12:41 AM
Try:

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.

You can also search for examples on Planet Source Code (http://www.planetsourcecode.com)

Gl,
D!m

[Edited by Dim on 09-13-2000 at 01:44 AM]

V(ery) Basic
Sep 13th, 2000, 12:50 PM
(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 ;) ...

V(ery) Basics Helper
Sep 13th, 2000, 12:58 PM
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 (http://www.planet-source-code.com/xq/ASP/txtCodeId.4450/lngWId.1/qx/vb/scripts/ShowCode.htm)

But if it is the exaple I think it is, mine is a whole world better.

(Not showing off or anything ;) )

Apocalypse Dude
Sep 14th, 2000, 11:48 PM
Thank for the help dudes.
Okay here's my email jspectrum@hotmail.com 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!!

Sep 18th, 2000, 11:39 PM
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/

Sep 19th, 2000, 02:43 PM
D!m: Yes I'm pretty sure that was me. I think the bitmap has to be 13x13 in order for it to fit.

V(ery) Basic
Sep 24th, 2000, 06:13 AM
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.

PRIVATE1
Sep 24th, 2000, 07:19 AM
I'd really like your menu demo also .

the_dischord@hotmail.com if you would be so kind .

Thanks
[]Private[]

Sep 24th, 2000, 07:24 PM
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

Apocalypse Dude
Sep 24th, 2000, 08:17 PM
Thanks V(ery) Basic. He's right, he does definitely rule



Having so much fun..