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

Thread: hiding toolbars

  1. #1
    Join Date
    May 1999
    Posts
    4

    hiding toolbars

    How can you enable the hiding and reappearance of additional toolbars.


  2. #2
    Join Date
    May 1999
    Posts
    36

    Re: hiding toolbars

    Hi,

    1) Create some resources on your menu to show and hide the tool bar (or context menu or whatever you want)

    2) In your mainframe class, handle the command to show/hide the toolbar (for example, I handle OnViewHideToolbar1 in response to the user checking, or unchecking a menu item under the View menu).

    The handler should look like this:


    void CMainFrame::OnViewHideToolbar1()
    {
    // first check it visible state (hidden or visible)
    BOOL bVisible = ((m_wndToolBar1.GetStyle() & WS_VISIBLE) != 0);
    // then toggle
    ShowControlBar(&m_wndToolBar1, !bVisible, NULL);
    RecalcLayout();
    }

    // then manage the update handler
    void CMainFrame::OnUpdateViewHideToolbar1(CCmdUI* pCmdUI)
    {
    BOOL bVisible = ((m_wndToolBar1.GetStyle() & WS_VISIBLE) != 0);
    pCmdUI->SetCheck(bVisible); // depending on your menu's wording...
    }




    I got this from somewhere. Maybe the VC++ docs, maybe the net... not sure.

    HTH,

    Harvey Hawes

    Software Engineer
    BioScience Analysis Software Ltd.

    Masters Candidate
    Cardiovascular/Respiratory Sciences
    Faculty of Medicine
    University of Calgary
    Calgary, Alberta, Canada

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