Results 1 to 2 of 2

Thread: Creating Components

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    1

    Exclamation

    I am a new VB programmer and I would like to know:
    How do you add components onto the form during runtime?
    For example:
    You start of with a form with just a command button.
    You click the button and it creates a new text box on the form. You click the button again and it generates another text box. How can I do this without having to create lots of invisible text boxes first. I want to be able to create as many text boxes as I want.

    Thanx

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Use a Control array

    If you just make one invisible textbox and set it's index property to 0

    You can then create as many as you like by using the commandline

    Code:
    Load Text1(1)
    to create the first one, then


    Code:
    Load Text1(2)
    to make the second one etc

    They'll all be invisible and in the same position as the first text box when you first create them, so remember to make them visible and move them.

    You can get rid of them with

    Code:
    Unload Text1(1)
    Which gets rid of the first one you created (text1(2) will still be there)

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