Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Editor

Status
Not open for further replies.

selimsl

Programmer
Aug 15, 2005
62
TR
Hi!

I created a menu using Menu Editor.My Menu is like as follows;
File
--New Project
--Open Project
--Save Project

I want to add icon(picture) to this menu,I mean

File
--(icon)New Project
--(icon)Open Project
--(icon)Save Project

How can I accomplish this job?

Thanks in advice

 
Hi,

If you searchh this forum for "bitmap menu" it turns up several examples including thread222-871110.

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
You can't do this directly from the VB IDE, I'm afraid. It takes some code and use of the API.

I'm pretty sure we've covered this in the past ... <fx: tappety tappety> ... yes, here's the most recent thread on the subject: thread222-871110
 
thread222-871110.

Yes.it works,but when my mouse is over the menu,the color of the bitmap changes.Can we prevent this?

Thanks
 
This is because this method replaces menu item check bitmaps and does not give you much control on its appearance. Size of the bitmap is also limited and depends upon the size of the font selected for menu items in display control panel.

The better way to do this is to use owner-drawn menus. You can specify your menu items to be owner-drawn using MF_OWNERDRAW flag. Windows sends WM_MEASUREITEM and WM_DRAWITEM messages when owner-drawn menu items are needed to be drawn. Processing these messages give you full flexibility and control on how icons (as well as text) are displayed in the menu item. You can also specify a larger size for the menu item so that a 16x16 icon fits in space correctly.

Note that this method requires subclassing and involves a lot of API and GDI stuff, atleast as compared to the previous method mentioned above, which is a lot easier, but less flexible.

A quick search for 'owner drawn menu' in VB section on gives some useful results.
 
See also SmartMenuXP control avaiable for free download at VBSmart.com. This control implements Office XP style menus in a very professional and impressive way.

This control is written in VB6 and also uses owner-drawn menus. The article also provides details about working of the control, although the complete source code is not available.

The web site, VBSmart.com contains some really smart controls that mimic Office XP style menus, toolbars and buttons. It was earlier hosted on its own domain name ( but now it appears as it has moved to a different location.

Unfortunately, this site has not been updated since November 2001, so we don't see Office 2003 style menus and other controls.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top