|
-
Oct 27th, 2001, 02:11 AM
#1
Thread Starter
Frenzied Member
How do you get icons next to menu items?
I created great menus, but I can't figure out how to get icons next to the text! I am just using the built-in menu editor for a vb form.
Is there another control I should be using (hopefully free!). Or am I just blind???
Thanks in advance!
-
Oct 27th, 2001, 02:21 AM
#2
Frenzied Member
i searched the fourm and found this code:
VB Code:
Declare Function GetMenu Lib "user32" _
(ByVal hwnd As Long) As Long
Declare Function GetSubMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPos As Long) As Long
Declare Function GetMenuItemID Lib "user32" _
(ByVal hMenu As Long, ByVal nPos As Long) As Long
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
Public Const MF_BITMAP = &H4&
Type MENUITEMINFO
cbSize As Long
fMask As Long
fType As Long
fState As Long
wID As Long
hSubMenu As Long
hbmpChecked As Long
hbmpUnchecked As Long
dwItemData As Long
dwTypeData As String
cch As Long
End Type
Declare Function GetMenuItemCount Lib "user32" _
(ByVal hMenu As Long) As Long
Declare Function GetMenuItemInfo Lib "user32" _
Alias "GetMenuItemInfoA" (ByVal hMenu As Long, _
ByVal un As Long, ByVal b As Boolean, _
lpMenuItemInfo As MENUITEMINFO) As Boolean
Public Const MIIM_ID = &H2
Public Const MIIM_TYPE = &H10
Public Const MFT_STRING = &H0&
Private Sub Command1_Click()
'Get the menuhandle of your app
hMenu& = GetMenu(Form1.hwnd)
'Get the handle of the first submenu (Hello)
hSubMenu& = GetSubMenu(hMenu&, 0)
'Get the menuId of the first entry (Bitmap)
hID& = GetMenuItemID(hSubMenu&, 0)
'Add the bitmap
SetMenuItemBitmaps hMenu&, hID&, MF_BITMAP, _
Picture1.Picture, _
Picture1.Picture
-
Oct 27th, 2001, 03:17 AM
#3
PowerPoster
Go to http://www.vbthunder.com, and look for the menu icons example, if you want to to put 3D icons in your menus (like office 2000).
-
Oct 27th, 2001, 03:19 AM
#4
So Unbanned
You could also send out stickers with the icons on them and have the users put the stickers on their monitor next to the menu... or not at all... they may find those little icons annoying... like me.
-
Oct 27th, 2001, 03:24 AM
#5
PowerPoster
Originally posted by DiGiTaIErRoR
You could also send out stickers with the icons on them and have the users put the stickers on their monitor next to the menu... or not at all... they may find those little icons annoying... like me.
I like to see/put the icons (3D or flat)next to the menu items.
-
Oct 27th, 2001, 03:25 AM
#6
So Unbanned
You could make fancy embossed stickers!
-
Oct 27th, 2001, 03:27 AM
#7
PowerPoster
Originally posted by DiGiTaIErRoR
You could make fancy embossed stickers!
yah, yah...and what about those office xp like icons?
-
Oct 27th, 2001, 03:28 AM
#8
So Unbanned
-
Oct 27th, 2001, 02:36 PM
#9
Thread Starter
Frenzied Member
Thanks
Im not sure about the sticker idea...would I have to make different size stickers depending on the users screen size and resolution? 
I understand your not liking icons, but I'm not just making a bunch of random icons for each menu item. I have one menu in which users can add smileys to their document, but instead of just having a list of smiley names (angry, happy, big grin, etc.) I think that would be an appropriate place to actually show the icon of the image they are inserting into their document.
Thanks for all your help, guys!
-
Oct 27th, 2001, 02:39 PM
#10
PowerPoster
Actually, I was wondering myself on how to make XP-style menus/toolbars/etc.
-
Oct 27th, 2001, 02:43 PM
#11
PowerPoster
Originally posted by eiSecure
Actually, I was wondering myself on how to make XP-style menus/toolbars/etc.
I don't know about menus but there is a button activex control that can be changes to a menu item. You can have shadowed picture and all other nice office xp menu effects.
Search the NET because I forgot on which website it was.
-
Oct 27th, 2001, 06:25 PM
#12
Hyperactive Member
Wow, stickers.... I'm gonna try that ....
And I'll make 'em so the user can't peal them off! Wow, why didn't Bill Gates think of this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|