Resize docking control in runtime
Hi all,
In the beginning, the dock control is docking to the bottom as 1/3 of the main form height.
I am able to get the information of ChildControllers, DICurrent.rcDockArea, etc. but it isn't enough.
The visible changes appeared when I call the SetBounds method.
if (dockHost.InternalController is DockHostController dhc)
{
var moveAbout = 50;
foreach (var child in dhc.ParentController.ChildControllers)
{
if (child is DragSplitterController dsc)
{
var r = dsc.HostControl.Bounds;
dsc.HostControl.SetBounds(r.X, r.Y + moveAbout, r.Width, r.Height);
}
else if (child is DockHostController dhc2)
{
var r = dhc2.HostControl.Bounds;
dhc2.HostControl.SetBounds(r.X, r.Y + moveAbout, r.Width, r.Height - moveAbout);
}
}
}
This solution has side effects, the original line of splitter stayed visible (see attached DockingSideEffect.zip).
Any tips?
Thanks.
Kind regards,
Kamil
Attachment: DockingSideEffect_7004afd2.zip
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
BR
Bharathi Rajakantham
Syncfusion Team
March 2, 2021 02:01 PM UTC
Hi Kamil,
Thanks for contacting Syncfusion Support.
We have checked the reported query “How to resize the DockControl in run time” from our end. You can achieve your requirement using the SetControlSize method.Please check the sample for your reference.
|
private void button1_Click(object sender, EventArgs e)
{
this.dockingManager1.SetControlSize(this.panel1, new Size(this.panel1.Size.Width, this.panel1.Height + 2));
}
private void button3_Click(object sender, EventArgs e)
{
this.dockingManager1.SetControlSize(this.panel1, new Size(this.panel1.Size.Width, this.panel1.Height - 2));
} |
Documentation Link: https://help.syncfusion.com/windowsforms/docking-manager/faq/general/how-to-get-or-set-the-size-of-the-docked-control
Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Docking_Move_Up_Down476355465
Please ensure our sample and let us know it satisfies your requirement if not please us more details on it. we will be glad to assist you.
Regards,
Bharathi R
Marked as answer
KG
Kamil Graf
March 2, 2021 06:40 PM UTC
Hi Bharati,
it's exactly what I need.
Thanks,
Kamil
BR
Bharathi Rajakantham
Syncfusion Team
March 3, 2021 01:38 PM UTC
Hi Kamil,
Thanks for your update.
We would be happy to hear that the provided solution is helpful for you. Please let us know if you have any other concerns, we will be glad to assist you.
Regards,
Bharathi R
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
KG Kamil Graf
- Mar 1, 2021 07:28 AM UTC
- Mar 3, 2021 01:38 PM UTC