CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    13

    How to get rid of the toolbar's auto disable fuction

    I've created a toolbar in one of my views and handled the message in the view. All works fine. But when that view is inactived, the buttons on the toolbar is auto disenabled. It looks urgly. If I handle the message in main frame it is enabled all the time. But I really want to handle the message in that view. How can I get rid of the MFC fuction.

  2. #2
    Join Date
    Dec 2003
    Posts
    95
    Just move the button's OnUpdateCmdUI() to the main frame,
    and leave the message handler in the view (i.e OnMyBtnClick() )


    hth

  3. #3
    Join Date
    Apr 2004
    Posts
    13
    I don't know how to move the OnUpdateCmdUI to MainFrame, the toolbar is a view's variable. But I've resolved the problem by you guide. Just override the OnUpdateCmdUI fuction.

    void CTrueColorToolBar::OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler)
    {
    CToolBar::OnUpdateCmdUI(pTarget, FALSE);
    }

    Thanks a lot.

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