Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Disable Docking
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Disable Docking

 Post Reply Post Reply
Author
Message
denczek View Drop Down
Newbie
Newbie


Joined: 06 August 2004
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote denczek Quote  Post ReplyReply Direct Link To This Post Topic: Disable Docking
    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?

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2006 at 2:41pm

Instead EnableDocking(CBRS_ALIGN_ANY); try CBRS_ALIGN_TOP

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
denczek View Drop Down
Newbie
Newbie


Joined: 06 August 2004
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote denczek Quote  Post ReplyReply Direct Link To This Post 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. 

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2006 at 4:37pm

Change first line also.

m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
denczek View Drop Down
Newbie
Newbie


Joined: 06 August 2004
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote denczek Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
denczek View Drop Down
Newbie
Newbie


Joined: 06 August 2004
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote denczek Quote  Post ReplyReply Direct Link To This Post 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.

 

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.