5,442,164 members and growing! (19,535 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » Miscellaneous Controls     Intermediate

DockManager Control

By Weifen Luo

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.
C#, Windows, .NET 1.0, .NET 1.1, .NETVisual Studio, VS.NET2002, VS.NET2003, Dev

Posted: 17 Aug 2003
Updated: 3 Aug 2006
Views: 244,968
Bookmarked: 253 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
154 votes for this Article.
Popularity: 10.28 Rating: 4.70 out of 5
8 votes, 5.2%
1
1 vote, 0.6%
2
0 votes, 0.0%
3
5 votes, 3.2%
4
140 votes, 90.9%
5

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

About the Author

Weifen Luo



Location: China China

Other popular Miscellaneous articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 305 (Total in Forum: 305) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralAsync invocation in tab constructor od OnLoad causes content not refreshing...memberSeishin#4:11 21 Aug '08  
GeneralLast accessed Tab not persisted Title is requiredmemberMilind Gogate2:17 1 Jul '08  
GeneralSample Code How To?memberV3RO6:07 25 Jun '08  
QuestionLicense agrementmemberbmtbf13:42 26 Feb '08  
GeneralRe: License agrementmemberbalazs_hideghety4:28 2 Apr '08  
Questionchild formmemberMember 459585822:17 28 Jan '08  
GeneralConvert to GOA WinForms? [modified]memberJeff Karlson13:55 19 Aug '07  
Question[?] how do i dock the windows in DockPanel.FloatWindows?membergeff_chang4:54 5 Jun '07  
GeneralDockPanel Suite 2.1 was released!!memberb2sing4u4:08 2 Jun '07  
GeneralCrtl+TabmemberSeishin#5:23 17 May '07  
QuestionSet Focus issuememberVenkatesan.M.DEVAN21:57 13 May '07  
GeneralProblem with autohidememberzvuk1230:43 24 Apr '07  
GeneralRe: Problem with autohidememberDavid Gevaerts18:15 17 Jun '07  
GeneralWindow WIDTH issue while showing / hiding in DOCKLEFTAUTOHIDEmemberAmbili_T2:01 20 Apr '07  
GeneralTooltip causes exceptionmemberrkuklinski23:19 13 Mar '07  
GeneralRe: Tooltip causes exceptionmemberPatrick Smacchia MVP.NET23:06 4 Sep '07  
QuestionAllowedStates - Content Classmember0:08 1 Feb '07  
GeneralSave of multi Documentmember0:25 25 Jan '07  
GeneralSave of multi Documentmember0:25 25 Jan '07  
GeneralSave of multi Documentmember0:24 25 Jan '07  
GeneralCommercial use?memberbherd23:48 24 Jan '07  
GeneralHow to can i set the width of the panel ...????memberhaterclay17:49 23 Jan '07  
GeneralsrcmemberAndrey, M1:16 14 Nov '06  
Generalresizingmembert3j014:50 9 Nov '06  
GeneralRe: resizingmember_VM5:54 7 Feb '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 3 Aug 2006
Editor: Chris Maunder
Copyright 2003 by Weifen Luo
Everything else Copyright © CodeProject, 1999-2008
Web16 | Advertise on the Code Project