-
March 16th, 2012, 10:58 AM
#1
Make undockable
I want to dock CDialogBar to the top of window in the code, and after that how can I make it impossible to dock-undock it with the mouse when app is running?
When I write
DlgBar->EnableDocking(CBRS_ALIGN_TOP);
MainFrame->DockControlBar(DlgBar, AFX_IDW_DOCKBAR_TOP);
DlgBar->EnableDocking(0);
It is placed at the top, as I wanted, but I can undock it with the mouse, and after that it can't dock to any side. How can I prevent it from being undocked?
-
March 16th, 2012, 11:39 AM
#2
Re: Make undockable
Just create it using CBRS_TOP style.
Code:
DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP;
VERIFY(m_dialogBar.Create(this, IDD_DIALOGBAR, dwStyle, AFX_IDW_DIALOGBAR));
No further other call.
-
March 16th, 2012, 12:12 PM
#3
Re: Make undockable
Originally Posted by ovidiucucu
Just create it using CBRS_TOP style.
Code:
DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP;
VERIFY(m_dialogBar.Create(this, IDD_DIALOGBAR, dwStyle, AFX_IDW_DIALOGBAR));
No further other call.
thanks
Last edited by Oleksii; March 16th, 2012 at 12:15 PM.
-
March 19th, 2012, 06:22 AM
#4
Re: Make undockable
Originally Posted by ovidiucucu
Just create it using CBRS_TOP style.
Code:
DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP;
VERIFY(m_dialogBar.Create(this, IDD_DIALOGBAR, dwStyle, AFX_IDW_DIALOGBAR));
No further other call.
And if I want to have several CControlBars in my Frame, and other ones I docked to the top, if I create DialogBar this way, it is always below docked one, how can I make it to be on the very top?
-
March 19th, 2012, 07:18 AM
#5
Re: Make undockable
Did you try CFrameWnd::DockControlBar?
Victor Nijegorodov
-
March 19th, 2012, 07:25 AM
#6
Re: Make undockable
Originally Posted by VictorN
Did you try CFrameWnd::DockControlBar?
Yes, it is shown in the first post.
I describe the problem again:
I have several CControlBars. All of them must bu on the top of my frame. And first from the top must be CDialogBar, but that CDialogBar must be undockable. The other CControlBars I dock to the window with DockControlBar, and if I use DockControlBar to my CDialogBar control, it can be undocked with mouse, So the question is still the same - how can it be prevented to be undocked
-
March 19th, 2012, 07:32 AM
#7
Re: Make undockable
Originally Posted by Oleksii
Originally Posted by VictorN
Did you try CFrameWnd::DockControlBar?
Yes, it is shown in the first post.
I meant, did you try to use the third parameter of DockControlBar?
Victor Nijegorodov
-
March 19th, 2012, 08:38 AM
#8
Re: Make undockable
Originally Posted by VictorN
I meant, did you try to use the third parameter of DockControlBar?
When I do DockControlBar to CDialogBar, it can be undocked, when just create it, adding third parameter when I create other controls doesn't help - CDialogBaris still under all other controls
-
March 19th, 2012, 08:47 AM
#9
Re: Make undockable
Could you show your code?
Victor Nijegorodov
-
March 19th, 2012, 01:01 PM
#10
Re: Make undockable
Originally Posted by Oleksii
... So the question is still the same - how can it be prevented to be undocked
Have a look at Locking Rebars and Toolbars article.
Victor Nijegorodov
-
March 20th, 2012, 05:38 AM
#11
Re: Make undockable
Originally Posted by VictorN
I founded that one, with CDialogBar it's not that simple )
So finally I decided this way - I dock every control, but after that I just handle mouse events for my CDialogBar to prevent it from being undocked.
Thanks everyone for attention and help.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|