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.

Determining window dock location

Thread ID:

Created:

Updated:

Platform:

Replies:

13519 Apr 30,2004 05:55 AM May 10,2006 03:12 PM Windows Forms 8
loading
Tags: Tools
Patrick
Asked On April 30, 2004 05:55 AM

Hi, I am using the docking manager to control my child windows. I am looking for a way to determine the window''s docked position at runtime. i.e docked to the left, top, right or bottom. thanks.

Administrator [Syncfusion]
Replied On April 30, 2004 06:53 AM

Hi Patrick, You could do so by accessing the DockInfo object associated with each docking window. The DockInfo object''s dStyle property specifies the DockingStyle and the rcDockArea specifies the rectangle that contains the docking window. Please refer to the code snippet below : Syncfusion.Windows.Forms.Tools.DockHost dhost = panel.Parent as Syncfusion.Windows.Forms.Tools.DockHost; Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as Syncfusion.Windows.Forms.Tools.DockHostController; Syncfusion.Windows.Forms.Tools.DockInfo di = dhc.GetSerCurrentDI(); left = di.rcDockArea.Left; top = di.rcDockArea.Top; bottom = di.rcDockArea.Bottom; right = di.rcDockArea.Right; string dockStyle = di.dStyle.ToString(); I have attached a complete sample here which illustrates the above. Let me know if you need any additional information. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On May 5, 2006 11:38 PM

This seems to provide the information about where the control was docked, but not the control''s current information. For example, if I dock a control then resize it the information I get is about the size of the control when it docked and not the current size. Is there a way to get the DockInfo refreshed to the control''s current size? > >Syncfusion.Windows.Forms.Tools.DockHost dhost = panel.Parent as Syncfusion.Windows.Forms.Tools.DockHost; > Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as Syncfusion.Windows.Forms.Tools.DockHostController; > Syncfusion.Windows.Forms.Tools.DockInfo di = dhc.GetSerCurrentDI(); > > left = di.rcDockArea.Left; > top = di.rcDockArea.Top; > bottom = di.rcDockArea.Bottom; > right = di.rcDockArea.Right; > > string dockStyle = di.dStyle.ToString(); >

Vijayanand S [Syncfusion]
Replied On May 6, 2006 10:27 AM

Hi Don, You can get the current size and docking style of the Docked window using DockHostController.DICurrent property. dockwindow_position.zip Please take a look at the modified sample and let me know if it resolves your requirement. Thanks for using Syncfusion Products. Regards, Vijay

Administrator [Syncfusion]
Replied On May 9, 2006 12:32 PM

I took a look at the sample, but this does not give me the number I need to recreate the dock. I tried to modify your example to show what I mean but I can''t get it to dock a dynamically created panel. Maybe you can explain to me what is wrong with this code. I keep getting ArgumentOutOfRangeException when I try to dock it: (defined as part of Form1) private System.Windows.Forms.Panel panel3; (inserted in Form1 constructor after InitializeComponent()) panel3 = new Panel(); panel3.Name = "panel3"; dockingManager1.DockControl(panel3, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Bottom, 200); dockingManager1.SetDockLabel(panel3, "panel3");

Vijayanand S [Syncfusion]
Replied On May 10, 2006 02:30 AM

Hi Don, Syncfusion Docking Manager loads/ initializes the docking windows properties and states after the Form Load event. If you want to create or get the properties of docking windows during application startup, you could use the statement within the NewDockStateEndLoad event. This event will trigger at the end of the Form Load event. Please take a look at this modified sample and let me know if this meets your requirements. Modified sample Thanks, Vijay

Administrator [Syncfusion]
Replied On May 10, 2006 10:27 AM

I see, thank you. Your new sample exposes the issue I have. Even though Panel3 is docked bottom with a size of 200, the rcDockArea says 196. What I am looking for is a way to get the 200 back out.

Vijayanand S [Syncfusion]
Replied On May 10, 2006 10:58 AM

Hi Don, Thanks for the update. DockingManager sets the control size after reducing the splitter width (Given size - SplitterWidth). DockingManager''s default splitter width is 4. That''s why it displays the actual control size as 196 eventhough the size is set as 200. Please let me know if you have any questions. Regards, Vijay

Administrator [Syncfusion]
Replied On May 10, 2006 03:12 PM

Perfect! Thanks, that is exactly what I needed.

CONFIRMATION

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.

;