We help IT Professionals succeed at work.
Get Started

How to make two toolbars dock in a row

rupak_khurana
on
420 Views
Last Modified: 2013-11-20
Please have a look at this code and tell me how to make the two toolbars appear one after the other instead of one below the other. The two toolbars are m_wndToolBar and m_sortToolbar :-

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
      }


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


      m_wndToolBar.EnableDocking(CBRS_ALIGN_TOP);
      m_sortToolbar.EnableDocking(CBRS_ALIGN_TOP);
      EnableDocking(CBRS_ALIGN_TOP);

      DockControlBar(&m_wndToolBar);
      DockControlBar(&m_sortToolbar);

***********************************************************
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE