<lo*********@gmail.comwrote in message
news:11*********************@80g2000cwy.googlegrou ps.com...
>
WebNewsReader wrote:
>ok, that fixes my needs
but there is a way to create using an array ?
So now you want an array filled with buttons, huh? Ok!
You can try this:
dim btnArray as new ArrayList(10) 'estimate the capacity you'll need. I
guessed at "10".
there are other structures you can use, such as a generic list.
then you can add buttons like this:
dim myButton as new Button
btnArray.add(myButton)
and loop through the array like this:
for each btn as Button in btnArray
...
'some code goes in here
next
Hmm, if the number of buttons are known at compile-time, or even at runtime
prior to creating the buttons, I would use an array rather than arraylist.
But if the total number of buttons are unknown until they are all created,
then using an ArrayList or List would be the way to go (I'm unfamiliar with
the List<generic class, so you may also want to look into this as it may
be just as efficient as using a normal array, but I'm not sure)...
HTH,
Mythran