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
close icon

change docking behaviour - DockingManager

Please help guys,

I have two panels on a form controlled by the docking manager.

I want one of the panels to always fill the entire client area.

I want a label, button or linkbutton at the top of the page for handling the second panel when this link is clicked two things can happen depending on the state of the second panel.

If the second panel is visible, it becomes closed. If on the other hand the second panel is closed, it becomes opened.

The main panel is resized to accommodate the second panel when it is visible and resized to fill the entire client area when the second panel is not visible.

I also want to remove the docking, autohide and close buttons for both panels

6 Replies

MU Murugan Syncfusion Team June 7, 2007 09:28 PM UTC

Hi Nedu,

1. I want one of the panels to always fill the entire client area.

To fill the entire client area, could you please set DockingManager.DockToFill to true.

[Code]
this.dockingManager1.DockToFill = true;

2. I want a label, button or linkbutton at the top of the page for handling the second panel when this link is clicked two things can happen depending on the state of the second panel. If the second panel is visible, it becomes closed. If on the other hand the second panel is closed, it becomes opened.

This could be achieved by using the SetDockVisiblity method of the DockingManager in the button click event handler.

[Code]
private void button1_Click(object sender, EventArgs e)
{
if (this.dockingManager1.GetDockVisibility(this.panel2))
{
this.dockingManager1.SetDockVisibility(this.panel2, false);
this.button1.Text = "Show Panel2";
}
else
{
this.dockingManager1.SetDockVisibility(this.panel2, true);
this.button1.Text = "Hide Panel2";
}
}

3. I also want to remove the docking, autohide and close buttons for both panels

Could you please set false to AutoHideEnabled, CloseEnabled and MenuButtonEnabled properties of the dockingManager.

[Code]
this.dockingManager1.AutoHideEnabled = false;
this.dockingManager1.CloseEnabled = false;
this.dockingManager1.MenuButtonEnabled = false;

[Sample]
http://websamples.syncfusion.com/samples/Tools.Windows/F62101/Main.htm

Thank you for your interest in Syncfusion products.

Regards,
Murugan P.S


NE Nedu June 10, 2007 03:53 PM UTC

seems like we have a version problem, I can't seem to find a CaptionButtons property or method for my docking manager object.

I am using version 4.402.0.51

I cant resolve the references when I load the sample project

Error in designer
Syncfusion.Windows.Forms.Tools.DockingManager' does not contain a definition for 'CaptionButtons'


GR Golda Rebecal Syncfusion Team June 11, 2007 07:35 AM UTC

Hi Nedu,

Sorry for the inconvenience caused.

Herewith I have attached the sample that uses v4.4.

http://websamples.syncfusion.com/samples/Tools.Windows/F62101_1/Main.htm

Best regards,
Golda


NE Nedu June 11, 2007 05:05 PM UTC

Thanks a million, that works like a charm.

another problem...
Is there a way I can control the size of the second panel when it is made visible.

If the panel visibility was set to false and the user clicks the button to make the panel visible, I want to control the size of the panel and make it as small as I want in relation to the current resolution of the users display.

Say, i'd like to make Panel2 occupy 20% of the client area and panel1 = 80% and when Panel2 is hidden I still want panel1 to occupy 100% of the client area.

I ask for this cause I noticed that when the second panel is closed and the application is stopped, on restart, it occupies more space than it did on the previous run of the app


MU Murugan Syncfusion Team June 11, 2007 10:41 PM UTC

Hi Nedu,

The docked control size could be controlled by using the SetControlSize method.

[Code]
private void button1_Click(object sender, EventArgs e)
{
if (this.dockingManager1.GetDockVisibility(this.panel2))
{
this.dockingManager1.SetDockVisibility(this.panel2, false);
this.dockingManager1.SetControlSize(this.panel2, new Size(100, 100));
this.button1.Text = "Show Panel2";
}
else
{
this.dockingManager1.SetDockVisibility(this.panel2, true);
this.button1.Text = "Hide Panel2";
}
}

Please try this and let me know if it works for you.

Thanks,
Murugan P.S


CH Chinedu June 12, 2007 02:53 PM UTC

Thanks a bunch Murugan. Really appreciate your help. That was exactly the method I was looking for.

Thank you very much for your help

Loader.
Live Chat Icon For mobile
Up arrow icon