Dockpanel suit-1

Source: Internet
Author: User

You must be impressed by the docking of Visual Studio. If you have used sharpdevelop, you will certainly be interested in the docking, this dockpanelsuit is a masterpiece of domestic experts.

Yes, his name is weifenluo. Here we will introduce his masterpiece winformsui. Docking and dockpanel suit for. net2.0. The current version is 2.3.1.0. You can get the source code of the latest version from here.

 

Let's talk about the general architecture.

This dockpanel suit mainly has five main elements:

  1. Dockpanel
  2. Dockwindow
  3. Dockpane
  4. Dockcontent
  5. Floatwindow
  • Dockpanel

This is the source of docking, inherited from system. windows. forms. panel, which manages all other controls, whether display, hide, or dragdrop. it can be seen from its built-in docksample that, during implementation, you only need to fill the dockpanel with the entire mainform. All other forms inherited from dockcontent only need to call the show (dockpanel) function, dockpanel automatically manages the form appended to the above

  • Dockwindow

In fact, for dockpanelsuit, dockpanel is not the only Panel attached to mainform, and dockwindow is also. dockwindow is a smaller unit than dockpanel. Why do I need to add a dockwindow after using dockpanel? The reason is very simple. dockwindow is used to divide dockpanel! So, so far, the architecture on your mainform should be like this. On a dockpanel, there are several dockwindows that divide the dockpanel into several pieces. by default, dockpanel uses dockwindow to create five areas: docktop, dockbottom, dockleft, dockright, and document) all regions belong to one of these five regions. dockpanel manages the location of dockpane through dockwindow. dockwindow is also inherited from system. windows. forms. panel

  • Dockpane

Dockpane is a unit that is smaller than dockwindow. It is a basic display unit of dockpanelsuit, And the UI seen by the end user is composed of dockpane. A dockpane includes a captionpane, A dockpanestrip, a splitter, and the corresponding dockcontents. dockpane can also be nested by itself, but only one can be nested. Therefore, dockpane also has only one splitter to freely drag and change the size of dockpanes. both captionpane and dockpanestrip are custom controls inherited from system. windows. forms. control. captionpane is the title bar of dockpane, while dockpanestrip is the tab bar of dockpane. dockcontent is the main display content of each dockpane. dockpane maintains all captionpane, dockpanestrip, splitter, and dockcontents, and specifies their respective bounds to combine a complete UI.

  • Dockcontent

Dockcontent is the basic content unit of dockpanelsuit. In fact, it is a form. for all forms that require docking, The dockcontent must be inherited. at the beginning, dockcontent was not appended to the corresponding dockpane. Instead, it was added by specifying the dockcontent parent as the corresponding dockpane, and dockpane calculates captionpane in the onlayout event, the positions of dockpanestrip, splitter, and dockcontent are combined to form a complete UI. it is worth noting that before specifying the dockcontent parent as dockpane, set the dockcontent toplevel to false. Otherwise, an exception such as "cannot add top-level control" is reported.

  • Floatwindow

In fact, floatwindow is the same as dockpane, but dockpane is attached to dockwindow, and floatwindow is a floating window. apparently, floatwindow is a form, and dockpanel manages the conversion between floatwindow and dockpane. This conversion process is nothing more than converting dockcontent from floatwindow to dockpane, or switch dockcontent from dockpane to floatwindow and display it.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.