Results 1 to 2 of 2

Thread: How to get array control with VBNET ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    66

    Question How to get array control with VBNET ?

    Hello,

    I would like to know how to proceed under VB.NET to create an array of controls (like the Index property under VB6).
    I know that this property no longer exist under VB.NET but there is normally another way to do it.

    I found an explanation in the help file but no example are given.

    For example, I want to create an array of PictureBox and be able to load Pictures from another array.

    Dice is an array of 5 that contains dice values from 1 to 6

    For i = 1 to 5
    picDice(i).Picture = picAllDices(dice(i)).Picture
    Next i

    Thaks for your help,
    Thierry

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    VB.NET doesn't have control arrays anymore, but if you load the pictureboxes at runtime, you can use an array of type picturebox.
    If you need events, you can add them at runtime with AddHandler.

    Try searching the VB.NET forum for control array

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