Solved

Menu Icons

Posted on 1998-06-12
7
266 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 100 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

636 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