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.
AdministratorMay 6, 2006 03:38 AM UTC
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 SMay 6, 2006 02:27 PM UTC
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.
AdministratorMay 9, 2006 04:32 PM UTC
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);
Vijayanand SMay 10, 2006 06:30 AM UTC
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
AdministratorMay 10, 2006 02:27 PM UTC
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 SMay 10, 2006 02:58 PM UTC
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.