Results 1 to 3 of 3

Thread: [RESOLVED] commandbutton array

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2005
    Posts
    528

    Resolved [RESOLVED] commandbutton array

    i have an array of 101 command buttons called carnivore(0 to 100) and i want them to all execute a piece of code. for example, i want them to all execute this piece of code:

    text1.text = carnivorevar(i).attack

    i being the index of the button i clicked

    is there any simple way to do this, i mean other than pasting the code into each and every command's click event?

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: commandbutton array

    if they're a control array, then it's just
    VB Code:
    1. Private Sub carnivore_Click(Index As Integer)
    2.     text1.text = carnivorevar(Index).attack
    3. End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2005
    Posts
    528

    Re: commandbutton array

    nice!

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