Syntax for multi-dimensional arrays?

C

Carl Mercier

Hi,

I'm trying to create a multi-dimensional (2) array of CheckBox in VB.NET.
Can't figure out the syntax... can anyone help?

Thanks!

here's my code:


Private _columns(,) As CheckBox
....
_columns(DaysCount, PeriodCount) = New CheckBox()
 
H

Herfried K. Wagner [MVP]

Carl Mercier said:
I'm trying to create a multi-dimensional (2) array of CheckBox in VB.NET.
Can't figure out the syntax... can anyone help?
[...]
Private _columns(,) As CheckBox
...
_columns(DaysCount, PeriodCount) = New CheckBox()

You'll have to either specify the number of elements in the array in the
variable declaration or in a 'ReDim'. Then you can populate the array
elements with instances of 'CheckBox' by iterating over the array elements
using nested loops.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top