Results 1 to 4 of 4

Thread: Adding Controls With Code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ireland, Dublin
    Posts
    76

    Talking

    Lets say I have a label on a form, how do I make a conotrol
    array of that label through code. o that I can have loads
    of controls on the form but only having to drag and drop
    one control on it.

    Any help would be much appreciated

    Cheers

    IJ
    ---------------------------------
    TopMan
    ---------------------------------

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176
    Once you dragged the One control onto the Form, set the Index property to 0(Zero), then it will be a Control Array and Extra controls can be added using the Load statement.

  3. #3
    Lively Member
    Join Date
    Oct 2000
    Location
    Chicago
    Posts
    97

    There is another way.....

    Change the name of the second label to the first one then also it will become control array
    Anil

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Speaking of other ways, just drag one label and copy & paste it on the form, VB will then ask if you want to create a label array, click yes and, voila!

    Anyway, Aarons way is faster, so use the one you like!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

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