|
-
Aug 1st, 2000, 08:31 PM
#1
Thread Starter
Lively Member
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
-
Aug 1st, 2000, 08:54 PM
#2
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
-
Aug 2nd, 2000, 12:07 AM
#3
Or you could
Logginto http://www.vbaccelerator.com and download their menu control, also you will need the ssubtmr.dll from their site. Just a thought.
-
Aug 2nd, 2000, 04:05 AM
#4
Fanatic Member
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.
-
Aug 2nd, 2000, 10:41 PM
#5
Thread Starter
Lively Member
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!
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
|