Docking windows winforms
Use the Visual Studio designer Properties window to set the anchored edges of a control. In the Properties window, select the arrow to the right of the Anchor property. Set the Anchor property on a control. In this example, a button is anchored to the right and bottom sides of its container:. Skip to main content.
This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. How to dock and anchor controls Windows Forms. Please rate your experience Yes No. Any additional feedback?
Important The Desktop Guide documentation for. Note Inherited controls must be Protected to be able to be docked.
Note Certain controls, such as the ComboBox control, have a limit to their height. Submit and view feedback for This product This page. View all page feedback. In this article. Here, four panels are added to the form and transformed to a docking window.
The GetEnableDocking function of docking manager helps to determine whether the child window is docking or not. The SetDockLabel function helps to set the label for a child window. The GetDockLabel function helps to get the label of the child window.
The DockControl function helps to dock a panel at the required side using the DockingStyle argument. The DockingStyle tabbed option is used to tab a panel with another panel. The tabbing windows need to be aware of the parent control name. The PersistState feature helps to save the current layout of the docking manager automatically to isolated storage while closing the form.
The dock state can also be saved by calling the SaveDockState function. The saved state can be reloaded by calling the LoadDockState function, whenever it is required to load the states.
Take a look at our next generation Bold Reporting Tools. Learn more. Suggest a Feature. Getting Started with Windows Forms Docking Manager 17 Nov 12 minutes to read This section explains how to design a DockingManager control in a Windows Forms application and overview of its basic functionalities. Assembly deployment The following list of assemblies should be added as reference to use the docking manager in any application: Refer control dependencies section to get the list of assemblies or NuGet package needs to be added as reference to use the control in any application.
Find more details about how to install the nuget packages in Windows Forms application in the following link: How to install nuget packages Creating simple application with docking manager You can create the Windows Forms application with docking manager control as follows: Creating the project Adding control via Designer Adding control manually in code Add dock child window Change Dock State of child Change Dock Side Make MDI child Serialize Dock windows Creating the project Create a new Windows Forms project in the Visual Studio to dock panels as like Visual Studio using the docking manager.
Adding control via designer To add the docking manager control to an application, drag it from the toolbox and drop in a designer view. The following required assembly references will be added automatically: Syncfusion. DockingManager dockingManager1 ; this. Container ; this. DockingManager this. Private dockingManager1 As Syncfusion.
DockingManager Me. Container Me. Panel panel1 ; private System. Panel panel2 ; private System. Panel panel3 ; private System. Panel panel4 ; this. Panel ; this. The SetDockLabel function helps to set the label for a child window. Dock panel size can be resized at run time using the splitters between the dock panels.
The docking manager provides a way to change the size of dock panels by programmatically. The SetControlSize function of docking manager helps to set the size of docked control. The GetControlSize function of docking manager helps to get the size of dock panel. This behavior can be enabled or disabled by using the ShowCaptionImages property. Its default value is true. To hide the caption image, set the ShowCaptionImages property to false.
The DockLabelAlignment property helps to align the caption label to left, right, and center position in the docking manager. The docking manager has following functions to retrieve and manipulate the buttons visibility in the CaptionBar. GetCloseButtonVisibility : Returns a bool value according to visibility of the close button. GetMenuButtonVisibility : Returns a bool value according to the visibility of menu button.
The SetDockVisibility function helps to set the visibility of docked control, and the GetDockVisibility helps to identify the visibility of docked control. CaptionButtons property allows you to customize the default buttons and to add new custom caption buttons. The docking manager allows to customize the default caption buttons. The docking manager allows to change the visibility of caption for dock panels. The ShowCaption property helps to show or hide the caption of the DockPanel.
You can hide the caption, by setting the ShowCaption property to false. The docking manager supports to maximize and restore the dock windows by using the maximize button, so that a clear view of contents can be obtained.
This can be enabled by setting the MaximizeButtonEnabled property to true. The maximize button will be visible only if any other control is docked to the bottom of the former control. A context menu will be displayed whenever users right-click the caption bar or click the menu button in the caption bar. You can show or hide the context menu of the docked window by using the EnableContextMenu property of docking manager.
The default value of this property is true. To hide the context menu in docked windows, set the EnableContextMenu property to false. Context menu items in the dock window caption can be customized using the DockContextMenu event of the docking manager. The ContextMenuItemText is used to remove the default menu items from the context menu.
The docking manager provides option to restrict user for resizing the dock panel to specified minimum size. The SetControlMinimumSize function helps to set the minimum size of docked control. FreezeResizing function helps to restrict the sizing of docking child windows. The splitter of the dock window can be customized using the SplitterWidth and MetroSplitterBackColor properties depends upon its values respectively.
VisualStyle property is set to Metro. Take a look at our next generation Bold Reporting Tools. Learn more.
0コメント