How to fix this error
First of all, if you encounter that error you will see a screen like this:To fix this you have to locate the designer file of the affected form or user control. Search for the Split Container generated source code. It will look like this:
//
// splMain
//
this.splMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.splMain.Location = new System.Drawing.Point(0, 0);
this.splMain.Name = "splMain";
//
// splMain.Panel1
//
this.splMain.Panel1.Controls.Add(this.ultraTabControl1);
this.splMain.Panel1MinSize = 300;
//
// splMain.Panel2
//
this.splMain.Panel2.Controls.Add(this.prgProperties);
this.splMain.Panel2MinSize = 250;
this.splMain.Size = new System.Drawing.Size(702, 339);
this.splMain.SplitterDistance = 448;
this.splMain.TabIndex = 0;
Now comment out the line where the Panel2MinSize property is set. It might be necessary to do the same for the SplitterDistance property. The resulted code should look now like this:
//
// splMain
//
this.splMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.splMain.Location = new System.Drawing.Point(0, 0);
this.splMain.Name = "splMain";
//
// splMain.Panel1
//
this.splMain.Panel1.Controls.Add(this.ultraTabControl1);
this.splMain.Panel1MinSize = 300;
//
// splMain.Panel2
//
this.splMain.Panel2.Controls.Add(this.prgProperties);
//this.splMain.Panel2MinSize = 250; <--- This is the cause of the error!
this.splMain.Size = new System.Drawing.Size(702, 339);
this.splMain.SplitterDistance = 448;
this.splMain.TabIndex = 0;
Now try to open the form again!
1 comment:
I have found a similar problem. Since I started naming my split containers explicitly I haven't run into the bug any more. Se here: http://www.selfelected.com/change-the-name-of-splitcontainer1/
Post a Comment