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

Thread: toolbar

  1. #1
    Guest

    toolbar

    how do I disable the toolbar at startup? in other words how do I start my application with the toolbar hidden?


  2. #2
    Join Date
    May 1999
    Posts
    82

    Re: toolbar

    If you just want to hide the toolbar add this line right before the return statement in the OnCreate() function of your main frame class

    ShowControlBar(&m_wndToolBar, 0, 0);

    or if you don't want the toolbar at all you can get rid of it by deleteing the following lines from the OnCreate function

    if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
    {
    TRACE0("Failed to create toolbar\n");
    return -1; // fail to create
    }

    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_wndToolBar);

    This has the side effect of leaving the toolbar option on the view menu. If you want to get rid of it completely you can start a new appwizard project and uncheck the toolbar option in the 4th dialog.


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