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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top