Dynamic GUI problem !

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guillaume BRAUX

    Dynamic GUI problem !

    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


  • Michael Nemtsev

    #2
    RE: Dynamic GUI problem !

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

    this.Controls.A dd(button);
    button.Click += new EventHandler(bu tton_Click);
    }

    void button_Click(ob ject 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




    "Guillaume BRAUX" wrote:
    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
    >
    >
    >

    Comment

    Working...