Is it possible to create a 2dimensional control array?
I want to be able to call the controls like Text1(1,3).text = ...
Possible with VB6 or not?
Printable View
Is it possible to create a 2dimensional control array?
I want to be able to call the controls like Text1(1,3).text = ...
Possible with VB6 or not?
It isn't possible, but why would you want to? If the reason is so that you can do a row and column type thing, you are probably better off with a single dimension array.
Euhm... Explain...
Indeed I need rows and columns... That's why I want to structure it. I'm making a mastermind game...
You can't create a two dimensional control array but you can simulate an array of controls.
VB Code:
Dim aGameBoard(9,4) as TextBox '10 x 5 Set aGameBoard(0,0) = Text1 Set aGameBoard(0,1) = Text2 '...etc Set aGameBoard(9,4) = Text50 'or if each row is a control array of Textboxes Set aGameBoard(0,0) = Text1(0) Set aGameBoard(0,1) = Text1(2) 'etc.. Set aGameBoard(9,4) = Text10(4) 'now access the textboxes through the array. aGameBoard(1,3).Text = "Hello World"
Wow... Very nice... Thx a lot, brucevde!