for loop issues with concatenating variable with text box
I have 10 text boxes textbox1, textbox2 ...etc
I want to modify them with a loop
this code does not work
Dim w as int
For w = 1 To 10
Me.TextBox & w = someStringArray(w - 1)
Next w
it does noe like the &, I tried + and () and [] and nothing works.
Any suggestions?
thank you.
[342 byte] By [
Hugocpp] at [2007-12-24]
VB6-
For w = 1 To 10
Me.TextBox(w ).Text= someStringArray(w - 1)
Next w
VB05
For each c as Control in Me.Controls
If TypeOf c Is TextBox then
Dim t as textbox = DirectCast(c, Textbox)
t.text = someStringArray(w)
W+=1
...
nice, I'm gettin closer to solving this thing
i tried the VB6 option and its giving me a compile error.
method or data member not found and its highliting ".Textbox"
i tried it with Me.Textbox(w).text and frmSomeForm.Textbox(w).text
but I get the same error.
thx for your help
Hey Man,
You ever got around your text box problem? I am facing the same issue Me.Textbox(w).text and frmSomeForm.Textbox(w).text, it doesnt seems to be working...
I would really appreciate if you share your code/experience with me?
TIA