[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Prevent Floating in CControlBar

Posted on 2002-06-17
5
Medium Priority
?
713 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 800 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

650 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