Change menu item text
-
It is possible to change the text of an menu item who has another branch menu ? I have tried classical solution:
pCmdUI->SetText(_T("&aaaa"));
but is working only on simple menu item ... if from this menu item go another menu items branch, the text have not change it ...
-
It is possible to change the text of an menu item who has another branch menu ? I have tried classical solution:
pCmdUI->SetText(_T("&aaaa"));
but is working only on simple menu item ... if from this menu item go another menu items branch, the text have not change it ...
-
It should work, but if you have a resource based menu it's possible the system is refreshing it from your resource details.
-
I put a TRACE macro inside of ON_UPDATE_COMMAND_UI handler, but strange, it doesn't call at all ... that is why the text is not changing ... this message (ON_UPDATE_COMMAND_UI) is not calling for menu items that has derived menu from itself ?
-
Yes, I did:
ON_UPDATE_COMMAND_UI(ID_VIEW_RENDERER1PLAN, &CMyAppDoc::OnUpdateViewRenderer1plan)
The fact is when I change menu item functionality, from this state (when from this menu is derived another menu item) into simple menu item, the text changing is working ...
-
Yes, I did:
ON_UPDATE_COMMAND_UI(ID_VIEW_RENDERER1PLAN, &CMyAppDoc::OnUpdateViewRenderer1plan)
The fact is when I change menu item functionality, from this state (when from this menu is derived another menu item) into simple menu item, the text changing is working ...
It is difficult to guess what may be happening in your code, but changing the text of a control should have no effect on the message passing and event handling for that control. I would try it myself but do not have MFC on my system. There is also some useful information at https://msdn.microsoft.com/en-us/library/65dtx4a4.aspx[^].