Solved

Prevent Floating in CControlBar

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 117
lucky13 challenge 11 145
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 95
Updating statistics with error notification email in SQL server 4 96
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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 …
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

810 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