|
-
August 29th, 2001, 06:12 AM
#1
menu and toolbar question
How can I add an icon in menu? is it posibble
How can I do dockable toolbar like Office style
thanks
-
August 30th, 2001, 03:11 AM
#2
Re: menu and toolbar question
Add the Icon in menu
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
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 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 '
public Const MIIM_ID = &H2
public Const MIIM_TYPE = &H10
public Const MFT_STRING = &H0&
public Sub ImgInPopUpMenu()
hMenu& = GetMenu(Main.hwnd)
hSubMenu& = GetSubMenu(hMenu&, 0)
' 3 is number of submenu have icon
hID& = GetMenuItemID(hSubMenu&, 3)
SetMenuItemBitmaps hMenu&, hID&, MF_BITMAP, _
Main.Picture1.Picture, _ 'Add picture
Main.Picture1.Picture
End Sub
Gordon Ngai
-
September 7th, 2001, 03:45 PM
#3
Re: menu and toolbar question
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
|