Size of windows and "docking" event

Docking/MDI for Windows Forms Forum

Posted 13 years ago by PetrK
Avatar
Hello,
I have a question. I have four tool windows in auto-hide panel on the right side of my application. All windows can be only docked, or can auto-hide. No docking to other sides or floating is enabled. And I want to do two things now. So the first question is, on which event is possible to close other docked window when user want to dock new one of these four? I mean for example tool window 1 is docked and user wants to dokc tool window 2 and I need to auto-hide the first one, so on which event?
And the second question is, how to disable to user at any occasion to resize any of these four tool windows? I mean not to resize, when it is docked and also not to resize when it is only in auto-hid container. Why i need this, beacuse I have listboxes and buttons arranged exactly fit to my size and the application will be used by non skilled users and I don't want them to be confused.
I really appriciate any suggestion, please help.
PetrK

Comments (4)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We still need to add an event for when a tool window state change occurs. That is one of the top things on the Dock controls TODO list.

For the disabling of resizing, we don't have that feature implemented yet. We could probably add it for the next maintenance release though.


Actipro Software Support

Posted 13 years ago by PetrK
Avatar
Hi,
I found "only one docked window" solution for me and everybody who is interrested in it.
Because my windows could have only two states (Docked, AutoHide), I have tried this, and it works:

private void toolWindow2_ParentChanged(object sender, EventArgs e)
{
if (toolWindow2.State == ActiproSoftware.UIStudio.Dock.ToolWindowState.AutoHide)
{
toolWindow1.State = ActiproSoftware.UIStudio.Dock.ToolWindowState.AutoHide;
toolWindow3.State = ActiproSoftware.UIStudio.Dock.ToolWindowState.AutoHide;
.
.
.
toolWindowN.State = ActiproSoftware.UIStudio.Dock.ToolWindowState.AutoHide;
}
}


And to resizing ... I am working on it. I am testing toolWindow.Parent.Size and toolWindow.Parent.Location properties set on toolWindow.SizeChanged event. It works on docked window, perfectly. But if it is in autoHideContainer, the window just "flies" :-) in application. If I find solution, I let you know.
PS: Sorry for my english :-/
Petr
Posted 13 years ago by Anthony Martin
Avatar
Didn't want to start a new thread until I was sure. I want to be able to know if a tool window is docked or undocked. Is this what you're talking about?
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Anthony,

You can always check the ToolWindow.State property to know what the tool window's current state is. If you want to be notified when a tool window's State property changes, we still need to add an event for that. Please let us know which you were looking for.

In the meantime, you could use the above sort of workaround.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.