Dynamically change a menu label 
Author Message
 Dynamically change a menu label

I am trying to change a menu item label text dynamically in reponse to a
menu
command. Here is the code that does not work, what could be my problem?

void CMainFrame::OnUpdateTrayHide(CCmdUI* pCmdUI)
{
 CString HideShow;

 if (m_AppInTray == false)
 {
  HideShow = _T("Hide");
 }
 else if(m_AppInTray == true)
 {
  HideShow = _T("Show");
 }

 pCmdUI->SetText(HideShow);
    MessageBox(HideShow); // this updates correctly so I know the string is
changing

Quote:
}



Fri, 06 May 2005 19:34:10 GMT  
 Dynamically change a menu label
Everything seems OK. Is it possible that this update is being done some
other place too and maybe thats overriding this?

--
Ajay Kalra [MVP - VC++]



Quote:
> I am trying to change a menu item label text dynamically in reponse to a
> menu
> command. Here is the code that does not work, what could be my problem?

> void CMainFrame::OnUpdateTrayHide(CCmdUI* pCmdUI)
> {
>  CString HideShow;

>  if (m_AppInTray == false)
>  {
>   HideShow = _T("Hide");
>  }
>  else if(m_AppInTray == true)
>  {
>   HideShow = _T("Show");
>  }

>  pCmdUI->SetText(HideShow);
>     MessageBox(HideShow); // this updates correctly so I know the string
is
> changing
> }



Fri, 06 May 2005 22:08:57 GMT  
 Dynamically change a menu label


Wed, 18 Jun 1902 01:00:00 GMT  
 Dynamically change a menu label
This was the bug:
The following was in my OnTrayNotification method, so i commented them out
and it works.
(TPM_LEFTALIGN | TPM_LEFTBUTTON /*| TPM_NONOTIFY | TPM_RETURNCMD*/)



Quote:
> I am trying to change a menu item label text dynamically in reponse to a
> menu
> command. Here is the code that does not work, what could be my problem?

> void CMainFrame::OnUpdateTrayHide(CCmdUI* pCmdUI)
> {
>  CString HideShow;

>  if (m_AppInTray == false)
>  {
>   HideShow = _T("Hide");
>  }
>  else if(m_AppInTray == true)
>  {
>   HideShow = _T("Show");
>  }

>  pCmdUI->SetText(HideShow);
>     MessageBox(HideShow); // this updates correctly so I know the string
is
> changing
> }



Sat, 07 May 2005 08:45:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Dynamically change menu text

2. Dynamically changing menu in MDI app

3. Dynamically change caption of a menu

4. Dynamically changing the menu

5. @@@ Dynamically change IE4 menu/toolbar?

6. Dynamically changing top-level menu in SDI app?

7. MDI Menus - how to change dynamically?

8. Dynamically changing menus in an MDI application

9. dynamically changing MDI MainFrame menu

10. change the menu prompt dynamically

11. change menu prompt dynamically

12. Dynamically changing text of a menu in a Dialog box

 

 
Powered by phpBB® Forum Software