Docking CControlBar derived classes in a CFrameWnd

Posted on 2004-11-09
Last Modified: 2013-11-20
I want to be able to dock 2 CControlbar dervied objects on the same side of a CFrameWnd in an SDI application forcing them to always stack on top of each other and never go side by side in the same area of the frame.  Or to be more specifc if the user drags one of these controlbars to the same side of the frame(lets say left) that the other one already exists on I NEVER want it to dock to the left or right of that control bar, but always above or below it (but still on the left side of the frame).  

Which of course leads me into the next problem of resizing each control bar appropriately depending on how much space they can occupy on the frames docking bar.

I have tried to search for a message that will notify me when a control bar is docked to the frame so I could make any necessary adjustments there, thinking that if I find out I have just docked 1 control bar on the same side where another one exists then I can simply recall DockControlBar on that one to force it above or below the existing one since the default behavior does not stick them side by side.

I have tried changing the CalcFixedLayout and CalcDynamicLayout functions of my control bar thinking I could change the rect in which it draws, but I have not succeeded.
Question by:JRVision2
    LVL 23

    Accepted Solution

    LVL 2

    Assisted Solution

    you can use an external library.
    we use:

    Author Comment

    Thanks guys, I've seen the sizecbar and been to the datamekanix web site before.  I'd like to avoid using any 3rd party toolkits or other subclasses.  Plus it bothers me there isn't a good way using just MFC.  I tried plugging in the sizecbar stuff and even it docks side by side sometimes when I don't want it to.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now