|
-
Dec 10th, 2003, 05:55 PM
#1
Thread Starter
Hyperactive Member
2dimensional array
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?
Kind Regards,
Pieter
PS: If you found someone's answer helpful, please be so kind to rate that person.
Thanks.
-
Dec 10th, 2003, 06:24 PM
#2
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.
-
Dec 10th, 2003, 07:09 PM
#3
Thread Starter
Hyperactive Member
Euhm... Explain...
Indeed I need rows and columns... That's why I want to structure it. I'm making a mastermind game...
Kind Regards,
Pieter
PS: If you found someone's answer helpful, please be so kind to rate that person.
Thanks.
-
Dec 10th, 2003, 08:42 PM
#4
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"
-
Dec 11th, 2003, 04:52 AM
#5
Thread Starter
Hyperactive Member
Wow... Very nice... Thx a lot, brucevde!
Kind Regards,
Pieter
PS: If you found someone's answer helpful, please be so kind to rate that person.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|