Hi
I'm trying to put an incon on my Menu and i couldn't do it, like MIcrosoft Word. So if you can help me , i apriciate
thanks
Printable View
Hi
I'm trying to put an incon on my Menu and i couldn't do it, like MIcrosoft Word. So if you can help me , i apriciate
thanks
Read this article.
Good luck!
I've made a really good app to do this really well.
I'm e-mailing it to you now...
Use the SetMenuItemBitmaps API. For this example, add a PictureBox, CommandButton and a Menu with SubMenus.
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, Picture1
End Sub
Check out this and follow the link for Menu Icons.
can you email me this program too?
[email protected]
i'm searching for an app, that can do this.
thanx
aj
Sure
*warm fuzzy feeling*
V(ery):
if its not to much trouble, could you send it to me ([email protected]) too?
V(ery) Basic
Can you send it to me too?
My e-mail is in my signature.
Parksie: I think that SetMenuItemBitmaps is a bit of a waste of time. When it inverts it looks horrible and it isn't at all like MS Office apps (I thought I'd start with a nice cheery compliment)
For all those people desperate enough to have my app lazing around on their HDD:
Just to explain the argumants of .AddMenuItem:
amString: The string name of the MenuItem you would like to add (not used for separator)
amItemType As MenuType: Use mtBitmap for String & Bitmap
Use mtString for String only
Use mtSeparator for a separator
mtCheckmark ain't coded yet (expected within a week)
amParam: If mtBitmap is set then this is the ListImages index of the Icon.
If mtCheckmark is set (this is to be coded) it is the ListImages index of an unhighlighted checkmark and it is assumed that the proveded ListImages index + 1 is the Listimages index of a highlighted checkmark. (To be coded within a week)
amNewMenu: If this is the beginning of a new menu (first item of a menu)
I'll send the update to everybody when it's done.
Once again, thank you for asking me for my virus <ahem> code. :D
Sorry to ba annoying V(ery) Basic, but could you please mail your app to me too!
Many thanks,
Steve.
Address follows:
With all the attention I'm getting over this I feel like I've actually done something useful.
<looks at code one more time>
Nah.
V(ery), it's time for you to create a website!
By the way, 1 is not a prime. :D
What's a website?Quote:
Originally posted by oetje
V(ery), it's time for you to create a website!
See the following thread for more details:
http://forums.vb-world.net/showthrea...threadid=26485
Cheers,
Steve.
Okay...V(ery), can I have that code too, please?
[email protected]
I'd be willing to share my information with fellow low-lifes. ;)
The insult is to me what a nice long pee-pee is to you.(getting dirty stuff out of your system in one satisfying go)