c++visual-studio-2010mfcwindows-forms-designercmenu

Creating a popup CMenu without a checkbox


I am creating a CMenu in Visual Studio 2010, MFC. I have a working CMenu that appears when a user right-clicks on a dialog. I can't seem to find a way to create menu selection without a spot for a checkbox. In Visual Studio's designer, my menu looks like this:

Checkbox

enter image description here

I wish to remove the area for a checkmark. In my application, my menu looks like this:

enter image description here

Is there a way to remove this small box, left of "Change Option"?

Update: Not sure this will help, but this is my code to create the CMenu:

CMenu menu;
VERIFY(menu.LoadMenu(IDR_MENU1));
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
CWnd* pWndPopupOwner = this;
while (pWndPopupOwner->GetStyle() & WS_CHILD)
            pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, screenPoint.x, screenPoint.y,
            pWndPopupOwner);

Solution

  • You will have to use an owner-draw menu for this. Popup menus always (by default) have space allocated for checkmark bitmaps. Going owner-draw will allow you to use CMenu::MeasureItem() and CMenu::DrawItem() to customize the size and drawing behavior of the menu object to your needs.