Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. two toolBars side by side

two toolBars side by side

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LeeeNN
    wrote on last edited by
    #1

    in My MDI, i have two toolBars. when run app, the standard toolBar is on top, another toolBar is below it. How can I manage the second toolBar beside the standard toolBar? thanks:^)

    O 1 Reply Last reply
    0
    • L LeeeNN

      in My MDI, i have two toolBars. when run app, the standard toolBar is on top, another toolBar is below it. How can I manage the second toolBar beside the standard toolBar? thanks:^)

      O Offline
      O Offline
      ovidiucucu
      wrote on last edited by
      #2
      // NOTE: this is just a draft example to show the idea
      class CMainFrame : public CMDIFrameWnd
      {
      // ...
         CToolBar    m_wndToolBar;
         CToolBar    m_wndToolBar2;
      // ...
      };
      
      int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
      {
      // ... create and other blah-blahs ...
      
         m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
         EnableDocking(CBRS_ALIGN_ANY);
      
         DockControlBar(&m_wndToolBar);
      
         RecalcLayout();
         
         CRect rect;
         m_wndToolBar.GetWindowRect(rect);
         rect.OffsetRect(rect.right, 0);
      
         m_wndToolBar2.EnableDocking(CBRS_ALIGN_ANY);
         DockControlBar(&m_wndToolBar2, AFX_IDW_DOCKBAR_TOP, rect);
      
         return 0;
      }
      

      Ovidiu Cucu Microsoft MVP - Visual C++ -- modified at 12:34 Saturday 24th June, 2006

      L 1 Reply Last reply
      0
      • O ovidiucucu
        // NOTE: this is just a draft example to show the idea
        class CMainFrame : public CMDIFrameWnd
        {
        // ...
           CToolBar    m_wndToolBar;
           CToolBar    m_wndToolBar2;
        // ...
        };
        
        int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
        {
        // ... create and other blah-blahs ...
        
           m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
           EnableDocking(CBRS_ALIGN_ANY);
        
           DockControlBar(&m_wndToolBar);
        
           RecalcLayout();
           
           CRect rect;
           m_wndToolBar.GetWindowRect(rect);
           rect.OffsetRect(rect.right, 0);
        
           m_wndToolBar2.EnableDocking(CBRS_ALIGN_ANY);
           DockControlBar(&m_wndToolBar2, AFX_IDW_DOCKBAR_TOP, rect);
        
           return 0;
        }
        

        Ovidiu Cucu Microsoft MVP - Visual C++ -- modified at 12:34 Saturday 24th June, 2006

        L Offline
        L Offline
        LeeeNN
        wrote on last edited by
        #3

        Thank you very much. I spend lots of time trying to figure it out.:)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups