|
-
Dec 23rd, 2002, 02:06 PM
#1
Thread Starter
Junior Member
How can I create an array of TextBoxes or Labels?
Please, give me a code... or link.
-
Dec 23rd, 2002, 02:09 PM
#2
well do you want an array of controls? or a control array??
what are you trying to do exactly?
-
Dec 23rd, 2002, 02:12 PM
#3
Thread Starter
Junior Member
I need an array of controls...
-
Dec 23rd, 2002, 02:20 PM
#4
ok well lets say you have 2 text boxes on your form and you want to load them into an array
VB Code:
Dim txtBoxArray(1) as TextBox
txtBoxArray(0) = Text1
txtBoxArray(1) = Text2
where Text1 and Text2 are the text boxes on your form..
if you wanted labels and textboxes in the same array you could do something like
VB Code:
Dim MyControls(2) as Control
MyControls(0) = Text1
MyControls(1) = Text2
MyControls(2) = Label1
where Text1 and Text2 and Label1 are the controls on your form..
-
Dec 23rd, 2002, 02:31 PM
#5
Thread Starter
Junior Member
Thank you.
But If I need 64 (chess) TextBoxes???
-
Dec 23rd, 2002, 02:39 PM
#6
you would be better off with a control array for this than an array of controls... just make 64 boxes and name them all the same thing.. then they will all have an index property which is how you reference the individual boxes..
but why would you be using textboxes for a chess game?
-
Dec 23rd, 2002, 02:49 PM
#7
Thread Starter
Junior Member
OK, thanks.
The chess I've said for example...
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
|