Solved

Menu CheckBox Bitmap

Posted on 2004-08-16
4
473 Views
Last Modified: 2013-11-20
Im currently using the following code to toggle between different modes of operation via the menu:

    CMenu* menu = AfxGetMainWnd()->GetMenu();
    CMenu* subMenu = menu->GetSubMenu(1);

    subMenu->CheckMenuRadioItem( ID_MODE_EDIT, ID_MODE_ZOOM, ID_MODE_EDIT, MF_BYCOMMAND | MF_CHECKED );

The default bitmap for this displays a bullet point bitmap, instead of the tick\check bitmap.
Any ideas on how to achieve this without the SetMenuBitmap function again.

The event handler function is written in the doc class
0
Comment
Question by:spiffles
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Nass89
ID: 11817613
Hi,
Add OnUpdate menu item for the menu you wat to tick:

void ViewClass::OnUpdateMyMenu(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if(condition==TRUE)
pCmdUI->SetCheck(1);
else
pCmdUI->SetCheck(0);

}

Good Luck!
0
 

Author Comment

by:spiffles
ID: 11817685
thanks but i need to be
able to switch between to menu items
i.e. one checked and one not checked.
how do i uncheck the other one?

Thats why i was using CheckMenuRadioItem(). cept it has the stupid
bullet point bitmap
0
 
LVL 5

Accepted Solution

by:
Nass89 earned 25 total points
ID: 11827519
Hi,
Add the same OnUpdate for another Menu item and while you check first one uncheck another.

void ViewClass::OnUpdateMyMenuItem1(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if(condition==TRUE)
pCmdUI->SetCheck(1);
else
pCmdUI->SetCheck(0);

}

void ViewClass::OnUpdateMyMenuItem2(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if(condition==TRUE)
pCmdUI->SetCheck(0);
else
pCmdUI->SetCheck(1);

}

Good Luck!
0
 

Author Comment

by:spiffles
ID: 11889251
Thanks Nass!
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Whole sheet autoscrub still needed 19 50
Tab names are off by one 5 54
iSeries DB2 Query 2 95
wordmultiple challenge 12 131
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now