private void ResizeForm()
{
try
{
System.Windows.Forms.Control ctr2;
Control[] ctrls = null;
System.Drawing.Point p = new System.Drawing.Point();
//handle panel 1
foreach (System.Windows.Forms.Control ctr in Splitter.Panel1.Controls)
{
if ((ctr.Name.StartsWith("lbl")) && (ctr.Name.ToString() != "lblNodeLabel"))
{
ctrls = Splitter.Panel1.Controls.Find(ctr.Name.Substring(3), true);
if (ctrls.GetLength(0) > 0)
{
ctr2 = ctrls[0];
p.Y = ctr.Location.Y;
p.X = ctr.Width + 3;
ctr2.Location = p;
ctr2.Width = Splitter.Panel1.Width - ctr.Width - 8;
}
}
}
Splitter.Panel1.Refresh();
//handle panel 2
foreach (System.Windows.Forms.Control ctr in Splitter.Panel2.Controls)
{
if ((ctr.Name.StartsWith("lbl")) && (ctr.Name.ToString() != "lblLinkLabel"))
{
ctrls = Splitter.Panel2.Controls.Find(ctr.Name.Substring(3), true);
if (ctrls.GetLength(0) > 0)
{
ctr2 = ctrls[0];
p.Y = ctr.Location.Y;
p.X = ctr.Width + 3;
ctr2.Location = p;
ctr2.Width = Splitter.Panel2.Width - ctr.Width - 8;
}
}
}
Splitter.Panel2.Refresh();
}
catch (System.Exception e)
{
System.Windows.Forms.MessageBox.Show(e.Message);
}
}