Solved

Prevent Floating in CControlBar

Posted on 2002-06-17
5
682 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 111
while loop over for loop 7 115
noX challenge 17 130
Bartender label printing - switch on and off graphics 3 56
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 …
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 …
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 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