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.

Unexpected size change when docking from code

Thread ID:

Created:

Updated:

Platform:

Replies:

68347 Sep 18,2007 09:30 PM Sep 21,2007 12:27 AM Windows Forms 4
loading
Tags: Tools
Andrey Kozyrev
Asked On September 18, 2007 09:30 PM

We consider purchasing the Syncfusion Studio to be used in our new product. I'm doing the POC of using the Syncfusion Docking Library as a backbone of our IDE style application (like Eclipse, Visual Studio etc).

I ran into the problem I cannot overcome and understand. I created a sample to illustrate the issue. Please have a look:

public MainForm()
{
InitializeComponent();

// create a red view
this.red = new SizeView();
this.red.ForeColor = Color.Red;
this.Controls.Add(red);

// create a blue control
this.blue = new SizeView();
this.blue.ForeColor = Color.Blue;
this.Controls.Add(blue);

// set some docking mgr properties
this.dockMgr.DockToFill = false;
this.dockMgr.PersistState = false;

// dock red view to the right edge of the form with the width = 200 - works great!
this.dockMgr.DockControl(this.red, this, DockingStyle.Right, 200);

// dock blue view to the top of the red view with the height = 250 - makes the width of red and blue views = 502! Why?!
this.dockMgr.DockControl(this.blue, this.red, DockingStyle.Top, 250);
}

This code is shortened from what I have in the sample. Please run the sample to see the problem.

Thanks,
Andrey.

SyncFusionPOC.zip

Andrey Kozyrev
Replied On September 18, 2007 09:36 PM

.NET: 2.0
Visual Studion: 2005
Syncfusion Essential Studio: 5.2.0.25

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On September 20, 2007 04:11 AM

Hi Andrey,

Thanks for evaluating Syncfusion products.

The Essential Tools Docking Windows framework enables developers to add docking windows, similar to those found in the Microsoft Visual Studio.NET IDE, to their Windows Forms applications. At the most basic level a docking window may be defined as a control that attaches itself to a host form's border, is capable of being dragged around and docked to different edges within the form and can also be dragged off the host form and floated as an individual top-level window. The docking framework allows just about any child control on a form to be made into a fully qualified docking window.

While working with this docking windows through code we should Call the DockingManager.BeginInit() method to signal the object that initialization is starting and Call the DockingManager.EndInit() method to signal that initialization is complete. the above two methods inherits the ISupportInitialize, which allows controls to optimize for multiple sets to properties. As a result, you can initialize co-dependent properties or batch set multiple properties.

Please refer the sample from the below link, which illustrates the above,

http://websamples.syncfusion.com/samples/Tools.Windows/F68347/main.htm

This solves the width increasing issue.

Note: The BeginInit() and EndInit() have been excluded from being shown in the VS code editor. Hence you would not see this function being displayed in the dropdown.

Please let me know if you want any more details.

Thanks,
Fahad

Andrey Kozyrev
Replied On September 20, 2007 12:53 PM

Hi Fahad,

That works! :)

Thanks,
Andrey.

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On September 21, 2007 12:27 AM

Hi Andrey,

Thanks for the update.

Let me know if you have any other queries.

Thanks,
Fahad

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.

;