Pregunta

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.

¿Fue útil?

Solución

Calling

CMFCPopupMenu::RecalcLayout()
might work...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top