Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Resizing a form by dragging only one side

I'm currently modifying a form designer application written in C#. The original application had a 'properties' window which was a free-floating window (not an MDI child), and attempts to make it an MDI child just caused too many problems.

I wanted to make this window able to 'dock' to an edge of the main window, so I did the following:

I created a 'DockableArea' control, which contains a 'FormDock' control.

The DockableArea control is contained within the main window, with DockStyle = Full.
The FormDock control is docked to an edge of the 'DockableArea' control. Whenever the FormDock control is resized or repainted, it checks to see whether the properties window is docked to it, and if so changes the properties window's bounds to its own, and sets its border style to 'None' so it is unsizable.

I had a Splitter on the side of the FormDock control, but unfortunately when editing a form this is covered up by the backgroud of the editing window.

I was wondering if anyone has any ideas on how I could choose a side of the properties window when it is docked, and allow that side to be dragged to resize the form (and so the underlying FormDock)?

Thanks
[1292 byte] By [EvilPenguin] at [2007-11-11 10:03:20]