[VB6] How do you change the caption of a funtional array...

Discussion in 'Code Snippets and Tutorials' started by gawjus1234, Jun 4, 2007.

  1. gawjus1234

    gawjus1234 Level III

    Joined:
    May 22, 2007
    Messages:
    518
    Likes Received:
    3
    Location:
    Las Vegas
    How do you change the caption of a funtional array of command buttons. like all at the same time. or can you? because i have an array of 20 buttons and i am trying to change all 20 captions at the same time.
     
  2. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    well if the base is zero then try this code
    Code (Text):
    1.  
    2. dim x as long
    3. do until x =20
    4. button(x).caption = "Hi"
    5. x = x + 1
    6. loop
     
  3. gawjus1234

    gawjus1234 Level III

    Joined:
    May 22, 2007
    Messages:
    518
    Likes Received:
    3
    Location:
    Las Vegas
    ya i did the same sort of thing. i was just wondering if there was a built in function to make it a little easier. o well thanks for the little code. i always forget about long variables. thanks