Вопрос

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.

Это было полезно?

Решение

Calling

CMFCPopupMenu::RecalcLayout()
might work...

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top