Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Resizing and docking CExtControlBar dialog Collapse All
Subject Author Date
Lee Euna Nov 27, 2008 - 11:13 PM

hello, I have two guestions about CExtControlBar.

This is my codes below.


A_Bar.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_BOTTOM, true );

B_Bar.DockControlBarLTRB( 30, &Bar, AFX_IDW_DOCKBAR_LEFT);


A dialog, B dialog are bottom of the main dialog and B dialog is left of A dialog.

I select the A, B dialog’s width using DockControlBarLTRB(), but not Height.

I want to resize A, B dialog’s heights. So I find this website, I found that response.


The CExtControlBar::SetInitDesiredSize...() methods allow you to set the desired size for any control bar when it is single in a row/column or it is floating. In this case, it cannot affect the size of any othet bar, hence the desired size can really be set.


1. How to I set the width size of two CExtControlBar dialog initially except for using SetInitDesiredSize...() method?

2. When control bar is floating, can I fix control bar’s size(width+height)? If you can, please tell me about solution.


Technical Support Nov 30, 2008 - 12:34 PM

First of all, if you are going to set new control bar initial sizes in your project programmatically, then please ensure you have removed control bar state data from the registry (or file if you are using file-based control bar persistence). You should invoke the CExtControlBar::SetInitDesiredSizeHorizontal() method of the first bar before docking it initially to the bottom side of the main frame window using the CExtControlBar::DockControlBarInnerOuter() method. The CExtControlBar::SetInitDesiredSizeHorizontal() method is the only method which can set control bar’s height in pixels. To set the control bar’s floating size and position you should invoke its CExtControlBar:: SetInitDesiredSizeFloating() and CExtControlBar::SetInitDesiredPosFloating() methods. If you need to change floating position and sizes of control bar dynamically and run time, then you can do this like demonstrated in the following sample application:

There is another way to initial positions of all the bars easily. This way is acceptable if your software is distributed as installation. You can run your program, dock all the bars in it like you want to see the initially, close your program and insert the registry settings of your program into its installer.