User (Old forums)MemberJanuary 30, 2008 at 11:41 amPost count: 23064
I am trying to add a docked window to a form which is created with its state set to auto hide. This works fine if the dock position is not set; the tab is there as expected on the left side of form. However, I need it on the right.
After using DockTo with the dock position set to right the tool window appears pinned. Is there any way please to unpin it programmatically?
I’m currently evaluating docking windows so imagine I have missed many things.
Imported from legacy forums. Posted by Nigel (had 4759 views)Xceed SupportMemberJanuary 31, 2008 at 4:45 pmPost count: 5658
When I tested this, the ToolWindow is not set to AutoHide mode.
private void Form1_Load( object sender, EventArgs e )
MyToolWindow tw1 = new MyToolWindow();
tw1.Key = “tw1”;
MyToolWindow tw2 = new MyToolWindow();
tw2.Key = “tw2”;
dockLayoutManager1.ToolWindows.Add( tw1 );
dockLayoutManager1.ToolWindows.Add( tw2 );
tw2.DockTo( DockTargetHost.DockHost, Xceed.DockingWindows.DockPosition.Right );
To be sure it’s not in AutoHide mode, you can set the State of the ToolWindow in Docked mode.
tw2.State = ToolWindowState.Docked;
Imported from legacy forums. Posted by CharlesB (had 289 views)User (Old forums)MemberFebruary 1, 2008 at 4:43 amPost count: 23064
Thanks for your reply, but that is not what I meant. Sorry for the confusion. I think I do want the mode to be AutoHide (if my understanding of AutoHide is correct) but I want the tool window tab to be positioned on the right of the main form.
If I continue your example and after
which pins the window on the right of the form add:
tw2.State = ToolWindowState.AutoHide;
its tab appears on the left of the form.
So, what I really mean to ask is how to set up a tool window (or windows) that are not just docked to the right but “reside” there, but also keeping others on the left (as in Visual Studio). We have a MDI application so do not have the ability (I think) to make the DockTargetHost some ClientHost.
Imported from legacy forums. Posted by Nigel (had 543 views)User (Old forums)MemberFebruary 1, 2008 at 8:01 amPost count: 23064
I ought to add that if docked on the right, manually unpinning the window causes the tab to be aligned right.
I’ve found a workaround (not perfect): by separating the AutoHide from the main form’s constructor. If the docking happens in the constructor and the Autohide state is set in the Load (or Shown) event then the tab is right aligned but the downside is that it can be seen closing.
If the whole process, docking and state change, is moved to the Load (or Shown) events then the effect is the same as having it all in the constructor – left alignment. It seems then that having the docking and state set together effectively undoes the dock position and reverts to the default (?) left position.
Imported from legacy forums. Posted by Nigel (had 430 views)User (Old forums)MemberFebruary 5, 2008 at 5:26 amPost count: 23064
I’m slowly getting to understand this (I think). Both Docked and AutoHide are States and DockTo sets the State to Docked. It seems to me that layout and state should be separated. The two concepts seem to have become confused in the design. Apologies if I’m missing something.
Imported from legacy forums. Posted by Nigel (had 5364 views)
- You must be logged in to reply to this topic.