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. Image for the cookie policy date

Retrieving dock position information

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

3 Replies

PS Prakash S Syncfusion Team February 10, 2003 10:06 PM UTC

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


BV Bruno Vais February 11, 2003 04:47 PM UTC

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


PS Prakash S Syncfusion Team February 12, 2003 12:45 PM UTC

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

Loader.
Up arrow icon