Adding a Control to a Form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Bean

    #1

    Adding a Control to a Form

    When a control is created during program execution, how can the control add
    itself to the form's control collection?

    I'd like to do this without the control or the form having to know specific
    information about one another, like the newly control being able to obtain a
    reference to the containing form.

    Thanks,
    Tom


  • Nikhil Patel

    #2
    Re: Adding a Control to a Form

    You could do this as...

    this.Controls.A dd(MyNewControl );

    "Tom Bean" <tbean@t-a-c.com> wrote in message
    news:eNT6$%23rT DHA.2252@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > When a control is created during program execution, how can the control[/color]
    add[color=blue]
    > itself to the form's control collection?
    >
    > I'd like to do this without the control or the form having to know[/color]
    specific[color=blue]
    > information about one another, like the newly control being able to obtain[/color]
    a[color=blue]
    > reference to the containing form.
    >
    > Thanks,
    > Tom
    >
    >[/color]


    Comment

    Working...