Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

DockManager Control

0.00/5 (No votes)
3 Aug 2006 1  
DockManager control is designed to achieve docking capability for MDI forms. It can be used to develop applications with same look and feel as Visual Studio .NET.

IMPORTANT NOTICE: DockManager control is now obsolete and not supported. Please download the upgrade, DockPanel Suite, from sourceforge here.

Introduction

DockManager control is designed to achieve docking capability for MDI forms. It can be used to develop applications with same look and feel as Visual Studio .NET.

Complex hierarchies yet Simple Object Model

DockManager control mimics the user-interface style of drag and drop, dockable windows found within the Visual Studio .NET IDE. The screen shots show off the features:

The DockManager control maintains a very simple object model to achieve complex hierarchies. See the documentation for details.

Auto-Hide

DockManager has an auto-hide feature that enables valuable screen real estate to be preserved. In the screenshot below, all the tool windows are in auto-hide mode and the Solution Explorer tool window is currently being displayed:

Sample screenshot

Free drag and drop

At run time, the end-users can freely drag and drop windows to re-arrange to their preferred layout. The developer can limit this by simply setting some properties in Visual Studio IDE form designer.

Integration with the .NET framework and VS.NET

Working gracefully with other components is a very important factor all through the design of DockManager control.

At run time, the document window will be treated as a MDI form, so it gets all the MDI form�s features such as menu merge.

At design time, the control is fully supported by the Visual Studio .NET IDE. Most operations can be done by setting the properties in the form designer. Very few code need to be written.

Persistent to XML file

DockManager control can be persisted to XML file. By using this feature, the application can restore its screen layout every time it starts up. This is well demonstrated in the DockSample application.

Globalization design

DockManager control is designed to support multiple languages. Currently it�s available in English and simplified Chinese. To make localization to other language is very easy.

Terms and Conditions

DockManager control is provided as free software with source code provided. You can freely use it in your applications (commercial or non-commercial). Weifen Luo, The author of the control, owns the copyright of the control, and is NOT responsible for any damage in your application caused by using this control, directly or indirectly.

Weifen Luo will feel honored if his name appears somewhere in your applications using this control (about box, documentation, etc). He also welcomes all kinds of feedback (good or bad). Please feel free to contact him at: weifenluo@yahoo.com.

Credits and thankfulness

  1. Phil Wright, Magic UI Library ( http://www.dotnetmagic.com/). The code of Win32 API declaration, drawing of drag-and-drop shadow frame, InertButton control is from the Magic UI Library (I added more design-time support to the InertButton control). Though the implementation is completely different, the class names DockManager, Content, ContentWindow, FloatWindow remains the same from the library.
  2. JocobMVP, Moderator of http://www.windowsforms.com/, answered my question on how to obtain the control beneath the cursor, in the Control Development forum.
  3. Mike Harsh and May Ji from Microsoft Windows Forms team. After I reported the bug to them, their fast response was very impressive. May Ji also helped to provide workarounds.
  4. Those names mentioned in the Revision History who make suggestions or report the bugs.

Revision history

  • 1.0.0.0

    01-Aug-2003 - First release.

  • 1.1.0.0

    20-Aug-2003

    1. FIX: Workaround for the NativeWindow.AssignHandle/ReleaseHandle bug in .NET framework 1.1 by using Win32 API.
    2. FIX: Assigning null to ContentWindow.ActiveWindow now throws an exception when there is visible content.
    3. FIX: Added IsHidden property for content persisted into XML file.
  • 1.2.0.0

    02-Sep-2003

    1. FIX (Suggestion from Roger J): Reduced the screen drag-and-drop flickers. Add old status for class DropTarget, and testing code for class DragHandler, DockManager and TabWindow. If same as old status, no drag frame needs to be drawn.
    2. CHG: Changed the design time property category to Docking. Modifications made in string resource file.
    3. NEW (Suggestion from Israeli0): Added CloseButton property to class Content.
    4. NEW: Added the properties: DockManager.AllowRedocking, FloatWindow.AllowRedocking, ContentWindow.AllowRedocking and Content.AllowRedocking.
  • 1.2.1.0

    09-Sep-2003

    1. FIX (reported by adrian73): In DockWindow.OnAutoHide, assign a default value (400) in case of SystemParametersInfo API returns 0 for SPI_GETMOUSEHOVERTIME. The following setting value "0" to Timer.Interval will throw an exception.
    2. FIX (reported by Duane Hanes): Not properly dispose of ContentWindow
    3. FIX (reported by Chris Pels): Auto hide window position calculated incorrectly when DockManager control is not at position (0, 0). In DockManager.GetTabStripRectangle and DockManager.OnPaint, use Width/Height instead of Right/Bottom.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here