Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
Toggle docking position from code.
posted

I suspect this is an easy one, but I've spent a day and a half struggling with this.  

Objective:  Duplicate Outlook behavior for moving the reading pane. I want a toolbar button to toggle the position of a pane (actually a group of tabbed panes) between the bottom and right side.  A second button will toggle between showing and hiding a tree window docked to the left side.  The only Docking Manager actions I want the user perform directly are selecting tabs and resizing the panes.

I've searched and read everything I can find, but I still can't get it to work.  

The most obvious: myWindowsDockingArea.Dock = DockStyle.Right;  Is close, but usually causes the panes to float or they dock but take the entire area and then being unresizeable.  Do I need to do something with the DockAreaPane/DockableControlPane as well?

RepositionToPane seemed likely, but it looks like it only changes one panes relative to another on tabs.  I've tried changing the parenting to move panes, removing them from one DockableControlPane and adding them to another. 

The documentation seems silent on this.  Which either means that it's too obvious to need explaining ("Should I hold the hammer by the heavy end?"), or I'm asking the wrong question ("Do I need an SAE or metric wrench or to loosen this nail?").  

Could someone set be on the right track?  Is there some sample code that covers this?

Thanks,
Tom 

p.s. There doesn't seem to be a collection of WindowsDockingAreas anywhere, or a linkage from a control to it's DockableWindow or WindowDockingArea.  My current hack is to loop over all controls of type WindowsDockingArea and toggling the DockStyle for all but the one that holds my tree (which stays docked left).