|
-
Jul 28th, 2000, 05:12 AM
#1
Thread Starter
Hyperactive Member
I am trying to make a menu which loads a directory listing into a menu and add their default icon to the menus. The problem is that i cant make it look like the menus in ms office or vb itself. Does anyone know how to make these kind of menus. Please help.
-
Aug 2nd, 2000, 05:21 PM
#2
Do you mean adding bitmaps to them? Use the SetMenuItemBitmap API.
Add a PictureBox with a bitmap loaded in it.
Add a Menu with at least 1 SubMenu.
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 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.Picture, Picture1.Picture
End Sub
-
Aug 3rd, 2000, 12:45 AM
#3
Thread Starter
Hyperactive Member
I know how to do that. But the colours of the picture get inverted when the mouse is over it. How to correct that?
-
Aug 3rd, 2000, 08:27 AM
#4
Fanatic Member
-
Aug 3rd, 2000, 12:57 PM
#5
Thread Starter
Hyperactive Member
thanx,
-
Jul 23rd, 2008, 06:15 PM
#6
New Member
Re: Menus
the setmenuitembitmap wont work on a popupmenu if the menu is not visable whats a work around for this and no i dont want to add a dll or ocx or even a user conrol to the project
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
|