programmatically add/remove windows components

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

    programmatically add/remove windows components

    Hi,
    Is there a way to programmaticall y add/remove windows components in c# or in
    any other language
    What is the API fro that?


  • Rachel Suddeth

    #2
    Re: programmaticall y add/remove windows components

    Um... what is a "windows component"? Whatever it is, there is certainly a
    way to do it programatically in some language.

    If you mean can you add controls such as buttons or textboxes in C#, then
    yes it is very easy. The ability to do this is pretty much built into the C#
    language/.NET framework. You don't need a special API, you just need to
    learn how to use C#.

    "Tzvika" <zvika@castlelo gic.com> wrote in message
    news:e%23wlmXI3 EHA.3120@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > Hi,
    > Is there a way to programmaticall y add/remove windows components in c# or
    > in
    > any other language
    > What is the API fro that?
    >
    >[/color]


    Comment

    • Bruce Wood

      #3
      Re: programmaticall y add/remove windows components

      To echo Rachel's post, all you have to do is instantiate new
      Windows.Forms.C ontrol objects (such as Label, ComboBox, TextBox, etc)
      and then add them to the controls on your form. Similarly, you can
      remove controls from a form by calling the Remove method on your form's
      Controls property.

      The easiest way to get a quick lesson on how to add new controls
      programmaticall y is to create a new form using Visual Studio, place
      controls on it, and then go and look in your source code in the section
      marked "Windows Forms Designer generated code". Remember that the
      Designer does not perform any hidden magic: it just generates code to
      create what you created visually, so you can do the same things it does
      in your code with the same effect.

      Comment

      • Tzvika

        #4
        Re: programmaticall y add/remove windows components

        No,
        What I mean is to programmaticall y add/remove MSMQ for instance.

        "Bruce Wood" <brucewood@cana da.com> wrote in message
        news:1102443375 .773104.299520@ z14g2000cwz.goo glegroups.com.. .[color=blue]
        > To echo Rachel's post, all you have to do is instantiate new
        > Windows.Forms.C ontrol objects (such as Label, ComboBox, TextBox, etc)
        > and then add them to the controls on your form. Similarly, you can
        > remove controls from a form by calling the Remove method on your form's
        > Controls property.
        >
        > The easiest way to get a quick lesson on how to add new controls
        > programmaticall y is to create a new form using Visual Studio, place
        > controls on it, and then go and look in your source code in the section
        > marked "Windows Forms Designer generated code". Remember that the
        > Designer does not perform any hidden magic: it just generates code to
        > create what you created visually, so you can do the same things it does
        > in your code with the same effect.
        >[/color]


        Comment

        Working...