ADAdministrator Syncfusion Team April 30, 2004 05:53 AM
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.
ADAdministrator Syncfusion Team May 5, 2006 10: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();
VSVijayanand S Syncfusion Team May 6, 2006 09:27 AM
You can get the current size and docking style of the Docked window using DockHostController.DICurrent property.
Please take a look at the modified sample and let me know if it resolves your requirement.
Thanks for using Syncfusion Products.
ADAdministrator Syncfusion Team May 9, 2006 11:32 AM
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);
VSVijayanand S Syncfusion Team May 10, 2006 01:30 AM
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
ADAdministrator Syncfusion Team May 10, 2006 09: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.
VSVijayanand S Syncfusion Team May 10, 2006 09:58 AM
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.
ADAdministrator Syncfusion Team May 10, 2006 02:12 PM