CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 1999
    Posts
    14

    dynamically adding/removing controls

    hi,

    Is it possible (I'm sure it is, just no clue how to) to add/remove a control (in this case a textbox) to a control arrary durring runtime? Basically I just want the user to be able to add a new text box in to a form.

    thanks


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: dynamically adding/removing controls

    yes, it is. You create your initial textbox on your form and give it an Index property of 0,
    then in the event handler for adding a new control, code like this.
    load text1(1)
    text(1).visible = true ' important!
    then position the textbox somewhere:
    text1.move...

    or use VB 6's new Add method of the Controls collection.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured