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]
# 1

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

...

DMan1 at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 2

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

Hugocpp at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 3

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

Shiamak at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 4
DOes your textbox array already exist? Is this VB6 or .NET? In .Net you will have to create your own "control" collection/array/list to manage a group of controls!
DMan1 at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 5

DMan1 wrote:
DOes your textbox array already exist? Is this VB6 or .NET? In .Net you will have to create your own "control" collection/array/list to manage a group of controls!

Hi,

The array already exists and its a VB6 project.

TIA

Shiamak at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 6

Then you should be able to access the control array by name and index...

ControlArrayName(Index).Method

DMan1 at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic IDE...