Hello i have a Form which contains a groupbox with several labels.
After a click a new form opens with a groupbox as parameter..
But when i close that form the groupbox on original form has disapeared.
It happens at Controls.Add(De tail).. apperently its not the right way or any help would be appreciated.
code:
private void lnklblToeslagen _LinkClicked(ob ject sender, LinkLabelLinkCl ickedEventArgs e)
{
GroupBox gb = gbToeslag;
DetailForm df = new DetailForm(gb);
df.Show();
}
public partial class DetailForm : Form
{
public DetailForm(Grou pBox Detail)
{
InitializeCompo nent();
Detail.Controls .Add(Detail);
Detail.Location = new Point(20, 30);
this.Size = Detail.Size;
this.Width +=40;
this.Height += 60;
}
After a click a new form opens with a groupbox as parameter..
But when i close that form the groupbox on original form has disapeared.
It happens at Controls.Add(De tail).. apperently its not the right way or any help would be appreciated.
code:
private void lnklblToeslagen _LinkClicked(ob ject sender, LinkLabelLinkCl ickedEventArgs e)
{
GroupBox gb = gbToeslag;
DetailForm df = new DetailForm(gb);
df.Show();
}
public partial class DetailForm : Form
{
public DetailForm(Grou pBox Detail)
{
InitializeCompo nent();
Detail.Controls .Add(Detail);
Detail.Location = new Point(20, 30);
this.Size = Detail.Size;
this.Width +=40;
this.Height += 60;
}
Comment