Print Page | Close Window

Disable Docking

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4043
Printed Date: 10 November 2025 at 9:55am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Disable Docking
Posted By: denczek
Subject: Disable Docking
Date Posted: 21 April 2006 at 1:24pm

In a CXTMDIChildWnd based class I have a CXTToolBar placed on the left side of a window using the following code in the OnCreate method:

 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
 EnableDocking(CBRS_ALIGN_ANY);
 DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_LEFT);

Once the window appears with the toolbar docked on the left side of the window, I would like the toolbar to be stuck there so the user cannot drag it or undock it.  How do I do this?




Replies:
Posted By: Oleg
Date Posted: 21 April 2006 at 2:41pm

Instead EnableDocking(CBRS_ALIGN_ANY); try CBRS_ALIGN_TOP



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: denczek
Date Posted: 21 April 2006 at 3:16pm

I changed the code in the OnCreate procedure from:

 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
 EnableDocking(CBRS_ALIGN_ANY);
 DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_LEFT);

to

 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
 EnableDocking(CBRS_ALIGN_TOP);
 DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_LEFT);

Unfortunately, all it did was move the toolbar to the top of the window and it was still detachable. 



Posted By: Oleg
Date Posted: 21 April 2006 at 4:37pm

Change first line also.

m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: denczek
Date Posted: 21 April 2006 at 5:00pm

I changed the code in the OnCreate procedure from:

 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
 EnableDocking(CBRS_ALIGN_ANY);
 DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_LEFT);

to

 m_wndToolBar.EnableDocking(CBRS_ALIGN_TOP);
 EnableDocking(CBRS_ALIGN_TOP);
 DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_LEFT);

Unfortunately, I get the same results.



Posted By: denczek
Date Posted: 21 April 2006 at 5:07pm

Now if I change the code to:

 m_wndToolBar.EnableDocking(CBRS_ALIGN_LEFT);
 EnableDocking(CBRS_ALIGN_LEFT);
 DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_LEFT);

The toolbar comes up docked on the left and I cannot drag the toolbar if I grip it and do a drag.  But if I grip close to the single button I have on the toolbar, then it allows me to drag the toolbar and detach it.  In this case I can only reattach it to the left side of the window.  Ideally, I would like to not allow any way to detach the toolbar from the left side of the window.

 

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net