1

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);
4

1 回答 1

2

为此,您必须使用自绘菜单。弹出菜单总是(默认情况下)为复选标记位图分配空间。进行所有者绘制将允许您根据需要使用CMenu::MeasureItem()CMenu::DrawItem()自定义菜单对象的大小和绘制行为。

于 2015-05-12T21:29:21.117 回答