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
In WPF, usually the main interface is mostly the dockpanel root element, a dockpanel. top Main Menu, dockpanel. top toolbar, dockpanel. A bottom statusbar is used to create a main area of fill. However, there is often a misunderstanding about how to fill the elements that are full of space, because the
Reprint 1 Original address: http://www.cnblogs.com/haoxiaobo/archive/2005/03/02/111493.html
This control is good, you can easily achieve such as the VS 2003 in the window positioning, floating, dock, tab, and other interface effects, today has a free download to look at, use up or very easy, probably talk about, save later forget.There are several classes available in DockPanel, two important, one is DockPanel
I will not talk about the basic usage of dockpanel. There are a lot of online users. I want to talk about several small issues that need to be paid attention to when using dockpanel.
First:
People who have used dockpanel may encounter the following error:
Invalid Content: activecontent must be one of the visible contents, or null if there is no visible content.
T
WeiFenLuo.WinFormsUI.Docking.dll is a class library of the Open source project DockPanel Suite, which enables the ability to dock, drag, and pull like Visual Studio Windows. WeifenLuo.WinFormsUI.Docking is a powerful interface layout control that can save custom layouts as XML files and can load XML configuration files. Several classes are available in the DockPanel, with two important:
DockPanel Suite Quick Start Use tips 1.DockPanel Suite Quick Start
(1) Create a form that inherits from Dockcontent
public partial class Equipmenttreewindow:dockcontent and then slightly set some properties such as showhint (docking position) and so on.
(2) Declares that a main form contains a DockPanel. You can simply drag the control directly
Private WeifenLuo
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:
The basic use of DockPanel I will not say, online a lot, I want to say is in the use of DockPanel need to pay attention to a few small problems
The first one:
Anyone who has ever used a dockpanel may have encountered an error such as:
Invalid Content:activecontent must be one of the visible contents, or null if there is no visible Content.
The meaning of translat
Take a look at dockpanel suite and know how to use it.
This control is good and can easily implement window positioning, floating, dock, tab, and other interface effects such as vs 2003. I have time to download it today, it is quite easy to use. Let's take a look at it and forget it later.
Dockpanel provides several available classes, two of which are important: dockpa
using DockPanel and C # to make forms floating and docking (VS2010) Click the function window and then drag the mouse Form2 effect diagram as follows:
1. Download the DockPanel. on SF can be down to the latest version of the DLL and demo. Unzip the file to get the following image file:
2, build the main form (parent form): Frmmain. (1) New project: Floatingform(2) Copy Dockpanel.config and WeifenLuo.WinF
Take a look at dockpanel suite and know how to use it.
This control is good and can easily implement window positioning, floating, dock, tab, and other interface effects such as vs 2003. I have time to download it today, it is quite easy to use. Let's take a look at it and forget it later.
Dockpanel provides several available classes, two of which are important: dockpan
ArticleDirectory
1. Multi-Document Interface (MDI)
2. dockstate
3. dockpane and dockalignment
4. dockarea
5. documentstyle
6. Miscellaneous
The previous article mentioned the dockpanel suite, which can be docked. Next I will briefly introduce how to use this component. 1. Multi-Document Interface (MDI)
The main form of dockpanel suite is similar to the parent form of the MDI
1. Create a WinForm project, which generates a WinForm form Form1 by default.2. Refer to add Reference, browse->weifenluo.winformsui.docking.dll.3. Set the Form1 form Properties ismdicontainer:true.4. Browse->weifenluo.winformsui.docking.dll-> in the Toolbox with the option->.net component, right-click, Toolbox, DockPanel.5. Drag dockpanel onto the form FORM1, set the Dock property, I set: Fill.Docked form:
WrapPanel and DockPanel two are relatively simple layout containers. These two controls will compensate for some of the deficiencies of StackPanel WrapPanel Controls:The control's Orientation property, where controls are placed vertically in a stacked control or row, WrapPanelSimilar to StackPanel. In addition to stacking, WrapPanel contains controls that provide line-wrapping support. If theWhen the WrapPanel control provides more content than the c
Worked hard to write a addin plug-in, their own use of everything normal, sent to others will not play out DockPanel,Or just a panel when it pops up, no specific controls. After several times, the reason is:Using a third-party interface control DotNetBar, the development environment because the DotNetBar configuration is normal, so everything is OK,Other people's computers did not dotnetbar, so caused the DockPane
The dockpanel has a floating form, that is, the C # editor style, such:
Floating forms can be floating, docked (up or down), and paged (such as the file entry page ).
Follow these steps:
(1) first find weifenluo. winformsui. Docking. dll and download weifenluo. winformsui. Docking. dll (click to download ).
(2) Add the form to reference, create form 1 as the main form, and form 2 and Form 3 as the sub form. Add the dockpanle tool.
(3) Mai
The namespace in which the component resides:
System.Windows.Controls
Common Methods for components:
Getdock: Gets the value of the specified element dock () attached property.
Setdock: Sets the specific dock value of the specified element dock () attached property.
Component Common Properties:
LastChildFill: Gets or sets a value that indicates whether the last child element added to DockPanel is scaled to fill the remaining space.
Instance:
N
After reading this section, I found that DockPanel is the dock property in the past WinForm. The original Dock property is a child control setting, and its parent level is not set. Now WPF instead abstracts a dockpanel at the father level and then sets the dock property of its controls.
DockPanel has a LastChildFill property that is g
1.DockPanel: Above, below, left, right, middle as the basic structure layout waySimilar to the borderlayout in the Java AWT layout.However, unlike BorderLayout, where multiple controls can be placed at the same time, multiple controls placed in the same area are laid out in a stackpanel manner .Such as:The code is as follows:12"Buttona"Width=" -"dockpanel.dock="Top"/>3"buttonb"Width=" -"Horizontalalignment=" Right"dockpanel.dock="Top"rendertransformor
Dockpanel-the most regular layout Control
Such a dockpanel:
Each element]This edge is very good. The guy in the middle can take advantage of the blessing of the parent element lastchildfill = "true" and exclusively occupy the remaining area.
Observe the rules because of two points:
The element is docked to only one side, and the last element fills the blank area.
Strictly follow the first-in-first
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.