J
J. Freeman
On a winform I have 30 text boxes, named txtType0 though txtType29.
An array to hold info, Dim infoType(29) as String,
I would like to assign the text in each text box to its corresponding
variable. I know there has to be a better way to do it than this.
infoType(0) = txtType0.Text
infoType(1) = txtType1.Text
infoType(2) = txtType2.Text
This is what I am trying but cant find a way to get it to work.
Sub looper()
Dim loopnumber As Integer
For loopnumber = 0 To 29
infoType(loopnumber) = txtType& loopnumber & .Text
'also tried = txtType & (loopnumber) & .Text and
other Combinations
Next loopnumber
End Sub
Thank you very much, any help will be greatly appreciated
An array to hold info, Dim infoType(29) as String,
I would like to assign the text in each text box to its corresponding
variable. I know there has to be a better way to do it than this.
infoType(0) = txtType0.Text
infoType(1) = txtType1.Text
infoType(2) = txtType2.Text
This is what I am trying but cant find a way to get it to work.
Sub looper()
Dim loopnumber As Integer
For loopnumber = 0 To 29
infoType(loopnumber) = txtType& loopnumber & .Text
'also tried = txtType & (loopnumber) & .Text and
other Combinations
Next loopnumber
End Sub
Thank you very much, any help will be greatly appreciated