We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I know the current docking style of the Docked window?

Platform: WinForms |
Control: DockingManager |
Published Date: April 30, 2011 |
Last Revised Date: July 10, 2014


Get the control’s parent and cast this to type Syncfusion.Windows.Forms.Tools.DockHost. Now access the DockHost’s InternalController and get its current Docking Information from the DICurrent() method.

This will return an object of type Syncfusion.Windows.Forms.Tools.DockInfo. The DockInfo.DockingStyle member gives the dock position of the particular control.

If the control is floating, then DockingStyle will be equal to Syncfusion.Windows.Forms.Tools.DockingStyle.Fill.

Note : A new method called GetDockStyle is added to version 4.2 and later to get the dockingstyle directly.It returns object of DockingStyle

Please refer to the code sample below which shows how the DockInfo object can be captured:


// Suppose ctl is the docked control

DockHost dhost = ctl.Parent as DockHost;

DockHostController dhc = dhost.InternalController as DockHostController;

DockInfo di = dhc.DICurrent;

// Returns the DockingStyle of the docking window

return di.dStyle;


' Suppose ctl is the docked control

Dim dhost As DockHost = CType(IIf(TypeOf ctlParent Is DockHost, ctlParent, Nothing), DockHost)

Dim dhc As DockHostController = CType(IIf(TypeOf dhost.InternalController Is DockHostController, dhost.InternalController, Nothing), DockHostController)

Dim di As DockInfo = dhc.DICurrent

' Returns the DockingStyle of the docking window

Return di.dStyle

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon