Create an instance to a added usercontrol?

  • Thread starter Thread starter Tinus
  • Start date Start date
T

Tinus

Hello,

I've added a UserControl to my main Form:
this.Controls.Add(UserControl1);

But how to I create an instance to this added control so that I can change
its size, location etc.?

Hope someone can help me with this.

Thanks in advance,
Tinus
 
Hello Tinus,

UserControl1 uc = new UserControl1();
uc.Size = new Size(400, 400);

this.Controls.Add(uc);
 
Back
Top