Question

I filter CMFCPopupMenu items with nID and RemoveItem. Menu is defined in the resources. When OnContextMenu occurs I do

CMenu* pSubMenu = menu.GetSubMenu(5);
if (!pPopupMenu->Create(this, point.x, point.y, (HMENU)pSubMenu->m_hMenu, FALSE, TRUE))
   return;

...

if ((nID == ID_TREE_ITEM_MAT...
    pPopupMenu->RemoveItem(i);

After the job done I see whitespaces where menu items were before. How can I avoid that? Thanks in advance.

Was it helpful?

Solution

Calling

CMFCPopupMenu::RecalcLayout()
might work...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top