CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Menu, same question again

    I wrote the code for check and uncheck the menu in dialog base app,
    but it doesn't work.

    void CMyDlg::OnEditShow()
    {
    // TODO: Add your command handler code here
    // Do something...
    }

    void CMyDlg::OnUpdateEditShow(CCmdUI* pCmdUI)
    {
    // TODO: Add your command update UI handler code here
    if( m_bShow==TRUE )
    {
    pCmdUI->SetCheck(1);
    m_bShow=FALSE;
    }
    else
    {
    pCmdUI->SetCheck(0);
    m_bShow=TRUE;
    }
    }




    Could anyone tell me how can I check and uncheck the menu in dialog base app?

    Thanks in advance.


  2. #2
    Join Date
    Jun 1999
    Posts
    319

    Re: Menu, same question again

    Add this to the command code:
    CMenu* pMenu = GetMenu();
    pMenu->CheckMenuItem(yourID, MF_BYCOMMAND | MF_CHECKED);

    Let me know if this helps you.
    Best regards,
    Faby


  3. #3
    Guest

    Re: Menu, same question again

    Hi Faby,

    Thanks for your code, it works.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured