Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Menu Icons

Posted on 1998-06-12
7
Medium Priority
?
271 Views
Last Modified: 2010-04-10
Can anyone tell me how to have icons for menu items in Visual C++? (Like the ones
the Visual C++ menus use.)
0
Comment
Question by:onka34
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1165799
Use ModifyMenu with uFlags MF_BITMAP
0
 
LVL 1

Expert Comment

by:V245
ID: 1165800
Sure, MF_BITMAP is work partially. I mean that  your icon will have transparent color. In Visual C++ menu they use another way... ;-)
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1165801
If you want it to be transparent , just open that bitmap in the resource editor, and set it's background color to gray, like the color of the menu itself. 99% of users don't change the color of the menu
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:onka34
ID: 1165802
Can you tell me how they do it in Visual C++?
0
 
LVL 1

Expert Comment

by:V245
ID: 1165803
Yes, I can but your question is locked!
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1165804
You can create an owner drawn menu, override the WM_DRAWITEM message, and draw it yourself, using drawing methods. This is much harder, and I'm not sure that it worth the efforts
0
 
LVL 1

Expert Comment

by:V245
ID: 1165805
Be sure Mike, because if  MF_BITMAP is used the menu select bar will cover your icon (transparent mode). It isn't similar to VC++ menu. In addition, if MF_BITMAP is used it will be possible to show only two bitmaps for CHECKED and UNCHECKED item states. But if MF_OWNERDRAW is used you will get full control and will can to show 'plain' icon when item isn't selected or 3D-look icon ('pressed' or 'unpressed') when selected bar passes through item. In such case it is possible to show different icons for enabled or disabled item and so on. I guess they made VC++ menu in the same way.
Good luck! :-)
Vladimir
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question