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.

change docking behaviour - DockingManager

Thread ID:

Created:

Updated:

Platform:

Replies:

62101 Jun 7,2007 01:40 PM Jun 12,2007 10:53 AM Windows Forms 6
loading
Tags: Tools
Chinedu
Asked On June 7, 2007 01:40 PM

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

Murugan [Syncfusion]
Replied On June 7, 2007 05:28 PM

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

Nedu
Replied On June 10, 2007 11:53 AM

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'

Golda Rebecal [Syncfusion]
Replied On June 11, 2007 03:35 AM

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

Nedu
Replied On June 11, 2007 01:05 PM

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

Murugan [Syncfusion]
Replied On June 11, 2007 06:41 PM

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

Chinedu
Replied On June 12, 2007 10:53 AM

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

Thank you very much for your help

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.

;