WeiFenLuo.WinFormsUI.Docking.dll is a class library of the Open source project DockPanel Suite that allows you to dock, drag and drop Windows like Visual Studio. WeifenLuo.WinFormsUI.Docking is a very powerful interface layout control that can save a custom layout as an XML file that can load an XML configuration file. Several classes are available in DockPanel, with two important ones: DockPanel and Dockcontent. The DockPanel is inherited from the panel and is used to provide a floating and dock space for the subwindow of the floating dock; Dockcontent is inherited from the form class to provide a floating window base class. In other words, the Dockcontent object can be arbitrarily welt, floating, tabbing, and so on in the DockPanel object.
1. New WinForm Form
2. Modify WinForm Form Properties
This true ; This " MainForm " ; This " MainForm ";
3. Add a menu bar for the MainForm form
4. Solution Manager--Add references--Browse-->weifenluo.winformsui.docking.dll
5. Toolbox--Select items ...-->.net framework Components--Browse-->weifenluo.winformsui.docking.dll
6. Drag the DockPanel control in the toolbox to the MainForm form and drag with the following error:
The Project Properties dialog box and the application-to-target framework,-->.net framework 4, can be resolved
7. Set the DockPanel Control Dock property to fill
this. Dockpanel1.dock = System.Windows.Forms.DockStyle.Fill;
8. Add two WinForm forms, Dockpanelformmain and Dockpanelformside respectively, and modify both forms in the Code of the form to inherit from Dockcontent. and modify its FormBorderStyle property to Fixed3D, set Dockpanelformmain's BackColor property to white;
9. Add the following code to the MainForm Load event:
Dockpanelformmain dockPanelMain1 =NewDockpanelformmain ();d ockpanelmain1.show ( This. DockPanel1);d Ockpanelmain1.text="MainPanel1";D ockpanelformmain dockPanelMain2=NewDockpanelformmain ();d ockpanelmain2.show ( This. DockPanel1);d Ockpanelmain2.text="MainPanel2";D ockpanelformside dockpanelsideleft=Newdockpanelformside ();d ockpanelsideleft.show ( This. DockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft);d Ockpanelsideleft.text="Dockpanelleft";D ockpanelformside dockpanelsideright=Newdockpanelformside ();d ockpanelsideright.show ( This. DockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);d Ockpanelsideright.text="Dockpanelright";D ockpanelformside Dockpanelsidebottom=Newdockpanelformside ();d ockpanelsidebottom.show ( This. DockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);d Ockpanelsidebottom.text="Dockpanelbottom";
10, the program operation effect is as follows:
Reference Link: http://www.cnblogs.com/because/archive/2011/12/24/2300316.html
Use of DockPanel (referencing WeifenLuo.WinFormsUI.Docking.dll components) in WinForm