Dynamic GUI problem !

  • Thread starter Thread starter Guillaume BRAUX
  • Start date Start date
G

Guillaume BRAUX

Hello,

Here is exactly what I want to do in my app :

The main problem is that my app will work with a totaly dynamic GUI, so
buttons, label and so on have to be created at runtime.
When I click on a runtime created button, I want to load a UserControl
not yet instaciated and put it on a TabPage also created at runtime

How can I achieve this goal ?

Thanks,

Guillaume
 
{ //somewhere
Button button = new Button();
button.Name = "Dynamic";
button.Text = "Text Dynamic";
button.Location = new Point(100, 100);

this.Controls.Add(button);
button.Click += new EventHandler(button_Click);
}

void button_Click(object sender, EventArgs e)
{
MessageBox.Show("123");
}

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

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