Solved

Menu Icons

Posted on 1998-06-12
7
251 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
C++ assignment question 7 236
TCP/IP Socket - connection close results in data lost 14 140
Fully specialized class template function 21 142
How to convert MFC APP to Win32 APP. 19 93
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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

840 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