unpinning tool window

Docking/MDI for Windows Forms Forum

Posted 11 years ago by Kelly Leahy - Software Architect, Milliman
Version: 2.0.0096
Avatar
I have a user control that uses a dockmanager internally to allow docking of one of it's tool windows (only within it's bounds, instead of anywhere on the screen).

This user control is used in two of my forms. In one form, it's toolwindow should be unpinned, in the other it should be pinned.

I wanted to set this at design time and have it work properly, but the only way I could see to set the 'state' of the tool window was through the 'state' property and this doesn't seem to have any effect at design time.

Is there a way I can set this at design time or do I need to do it in the constructor of my form that wants it 'unpinned'. Also, what's the best way to go from unpinned to pinned through code? Is it setting the state property? How do I know which value to set it to in order to 'pin' the item? Doesn't the control when 'pinning' itself decide which way it is docked (internal or external)? How am I supposed to know which way to tell it to dock?

Kelly Leahy Software Architect Milliman, USA

Comments (3)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
By pinned and unpinned, you mean either docked in the host container, or in auto-hide mode along the edge of the host container, right? Just want to be sure I reply correctly.

If so, then you can right-click on a tool window titlebar and choose "Tool Windows..." in the menu. On there select the tool window to auto-hide and press the Auto-Hide button. It will auto-hide to whatever side the tool window is docked on.

In code, changing State is a fine way of doing what you want. When coming out of auto-hide mode, I believe by convention that it always goes back to docked mode (pinned).

Hope that helps!


Actipro Software Support

Posted 11 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
What I'm looking for is the 'proper' way to set the tool window to be in 'Auto-hide' mode at design time, but not through the designer (because it's in a user control and I can't do it that way).

It's not a big deal, I was just hoping it was easy - right now I'm just doing it at runtime in my constructor of the control containing the user control.

Also, I wanted to know the 'proper' way to 'pin' (i.e. change from Auto-Hide to whatever the opposite of it is) in a generic way (without knowing how the control was docked prior to unpinning it). It seems like I need to know something about 'internal' versus 'external' docking in order to do this via the 'State' property. How could I know that if the user was moving things around?

Kelly Leahy Software Architect Milliman, USA

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Maybe what you are doing is best then, after InitializeComponent in your user control is called, doing the State change to AutoHide.

When coming out of auto-hide mode, it always pins inside the host container. So just set the State back to DockableInsideHost for that.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.