C# splitContainer.SplitterDistance的问题
System.InvalidOperationException:SplitterDistance必须在Panel1MinSize和Width-Panel2MinSize...
System.InvalidOperationException: SplitterDistance 必须在 Panel1MinSize 和 Width - Panel2MinSize 之间。在主窗体上添加上splitContainer1控件,所有子窗体全显示在splitContainer1.Panel2中,只有一个子窗体A显示时会提示这个错误,其他窗体没有提示
,百思不得其解;
下面是 designer.cs文件中的定义
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 85);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.panel1);
this.splitContainer1.Panel1.Controls.Add(this.panel2);
this.splitContainer1.Panel1MinSize = 1;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("splitContainer1.Panel2.BackgroundImage")));
this.splitContainer1.Panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.splitContainer1.Size = new System.Drawing.Size(906, 431);
this.splitContainer1.SplitterDistance = 132;
this.splitContainer1.TabIndex = 11; 展开
,百思不得其解;
下面是 designer.cs文件中的定义
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 85);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.panel1);
this.splitContainer1.Panel1.Controls.Add(this.panel2);
this.splitContainer1.Panel1MinSize = 1;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("splitContainer1.Panel2.BackgroundImage")));
this.splitContainer1.Panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.splitContainer1.Size = new System.Drawing.Size(906, 431);
this.splitContainer1.SplitterDistance = 132;
this.splitContainer1.TabIndex = 11; 展开
1个回答
展开全部
建议看看微软给出的解释
http://msdn.microsoft.com/zh-cn/library/system.windows.forms.splitcontainer.splitterdistance(v=vs.80).aspx
http://msdn.microsoft.com/zh-cn/library/system.windows.forms.splitcontainer.splitterdistance(v=vs.80).aspx
参考资料: http://msdn.microsoft.com/
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询