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.
Unfortunately, activation email could not send to your email. Please try again.

Retrieving dock position information

Thread ID:





2700 Feb 10,2003 08:17 AM Feb 12,2003 07:45 AM Windows Forms 3
Tags: Tools
Bruno Vais
Asked On February 10, 2003 08:17 AM

Hi, How can I retrieve the docking state (top, bottom, right etc.) of a control? Are there any plans for an API like: DockingStyle GetDockingState(control, parent)? Thanks

Prakash S [Syncfusion]
Replied On February 10, 2003 05:06 PM

Bruno, It is not advisable to access the DockingStyle information as this information is completely contextual and attempting to utilize the DockingStyle as a standalone state in a custom persistence implementation will be problematic. The correct approach for a custom persistence mechanism would be via overriding the DockingManager's LoadDockState/SaveDockState/ApplyDeserializedState functions, and modifying it as needed in your derived implementation after studying the actual load/save sequence. Prakash

Bruno Vais
Replied On February 11, 2003 11:47 AM

Prakash, I need this API for testing purposes, not to save/load the manager. My application makes extensive use of DockControl(...) and I need to test that the control was actually docked where I wanted. Also, for the same reason, I would need a GetLocation API that returns the location of a control. If I float a control, or set it as an MDI child, there's no way I can find out where it actually is. Thanks

Prakash S [Syncfusion]
Replied On February 12, 2003 07:45 AM

Hi Bruno, If it's just for testing the DockControl() method, then the control's current dockstate information can be retrieved through it's DockHost parent. The following code should give you an idea, Trace.Assert(this.dockingManager.GetEnableDocking(this.listBox1)); Syncfusion.Windows.Forms.Tools.DockHost dhost = this.listBox1.Parent as Syncfusion.Windows.Forms.Tools.DockHost; Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as Syncfusion.Windows.Forms.Tools.DockHostController; Trace.WriteLine(dhc.DINew.dStyle.ToString()); Please bear in mind that the DockingInfo value proivded by the DINew.dStyle attribute will reflect only that specified for the control when invoking the DockControl/FloatControl methods, and is not an accurate indicator of the Control's state within the docking layout. The Control's DINew.dStyle value will be 'DockingStyle.Fill' when FloatControl() was called on it. Prakash Syncfusion


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.