Float Windows and Allow Dock States in C# WinForms
In this tutorial, we will learn how to use the AllowedDockState property. This is a property that allows users control the available dock states per ToolWindow. This property has a few options that can be used together with bitwise operations.
The C# code snippet below will automatically will remove the caption buttons or closed for an unnecessary state.
In addition, developers can also disable the unnecessary menu items from the context menu. The following C# code is able to disable the Floating option:
How to Customize Float Windows
When using the Dock Control in Windows Forms project, we can float Windows, which offers a helpful way to rearrange pieces of content on the screen. The default value of the Floating Windows only appears with their close button enabled, and on top of the Dock Control that manages them. The following is a tutorial that shows how to change the behavior. In the tutorial, developers need to handle the FloatingWindowCreated event that will be fired when the end user drag a ToolWindow and float it. How to Enable Minimize and Maximize Buttons
If developers need to enable the Maximize and Minimize buttons when floating a Window, they can use the C# code below to handle the FloatingWindowCreate event and configure the properties of MinimizeBox, MaximizeBox and FormBorderStyle of the FloatingWindow
How to Place FloatingWindow under Main Form
When developers need put the FloatingWindow under the main form rather than on the top, where the Dock manager is included, they can extend the FloatingWindow class and use an instance of the extended type.
Then, developers need to pass a custom FloatingWindow instance to the How to Set FloatingWindow Theme
It is because that the FloatingWindow is a descendant class of Dock WinForm, developers can change the FloatingWindow theme by changing the ThemeName property in the FloatingWindowCreated event |
UI Controlsfor Windows Forms .NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlWinForms Dock UI ControlDock - Getting Started Architecture and Features Arrange WindowsFloating WindowsAuto-Hide WindowsContext MenuReDockObject Model Create a Dock WindowCreate WindowRemove WindowAdvanced LayoutTab & CaptionAllowed Dock StatesUser Control and FormsLoad and Save LayoutDock - LocalizationDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlWinForms Ribbon UI ControlWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |