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

Unexpected size change when docking from code

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

4 Replies

AK Andrey Kozyrev September 19, 2007 01:36 AM UTC

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


MS Mohamed Suhaib Fahad A. Syncfusion Team September 20, 2007 08:11 AM UTC

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


AK Andrey Kozyrev September 20, 2007 04:53 PM UTC

Hi Fahad,

That works! :)

Thanks,
Andrey.


MS Mohamed Suhaib Fahad A. Syncfusion Team September 21, 2007 04:27 AM UTC

Hi Andrey,

Thanks for the update.

Let me know if you have any other queries.

Thanks,
Fahad

Loader.
Live Chat Icon For mobile
Up arrow icon