Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Menu Icons

Posted on 1998-06-12
7
Medium Priority
?
278 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 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

824 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