Solved

Prevent Floating in CControlBar

Posted on 2002-06-17
5
668 Views
Last Modified: 2013-11-20
Hi,

I am using a CControlBar to implement a VS6 like dockable/floating tool palette. On the other hand, I would like to disalbe the floating part so that it only docks.

Does anybody have an answer?

Cheers
Yida
0
Comment
Question by:ymao
5 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7086351
Call CControlBar's EnableDocking function.

GOOD LUCK
0
 

Author Comment

by:ymao
ID: 7090108
Hi Roshan,

Thanks for getting back to me. Can you be more specific about when to call EnableDocking and with what params? It seems to me that EnableDocking only enables the CControlBar to be docked at a specific side of the frame window.

The user experience is that: I would like user to be able to dock the control bar to any side of the window. But I don't allow them to make the control bar float.

Thanks
Yida
0
 
LVL 16

Accepted Solution

by:
AlexNek earned 200 total points
ID: 7090174
2 ymao
When you create you toolbar pay attention to Create and SetBarStyle functions.

CToolBar::Create
parameter dwStyle must not have the flag CBRS_FLOATING.

BarStyle must not have the style CBRS_FLOAT_MULTI but CBRS_ALIGN_ANY.

dwOldStyle = ... GetBarStyle() & (~CBRS_FLOAT_MULTI);
...SetBarStyle( dwOldStyle | CBRS_ALIGN_ANY);

To dock toolbars to a frame window, the frame window (or destination) must be enabled to allow docking. This is done using the CFrameWnd::EnableDocking(CBRS_ALIGN_ANY)

After you have prepared the destination for docking, you must prepare the toolbar (or source) in a similar fashion. Call CControlBar::EnableDocking(CBRS_ALIGN_ANY) for each toolbar you want to dock.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 109
deburging in oracle form 12 76
dog bark java program 15 82
how to split multiple lines delimiter : 8 54
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

705 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

20 Experts available now in Live!

Get 1:1 Help Now