Sergio wrote:
how do i change the text property to a lot of textbox if all textbox are
calle textbox1, textbox2 .... instead of doing it one bye one, i mean
something like
for i as integer = 0 to 10
textbox & i .text = i
next i
You don't.
Finding Controls by name is a pain in .Net. Far better to use the
facilities of the [new] language.
Use a list of TextBoxes, load each of your individual TextBoxes (each
with its own, /meaningful/ name) into it, then loop through the list, as
in:
Private tbList As New ArrayList
' VB'2005 and later can use "List(Of TextBox)"
Sub New()
InitializeControls()
tbList.Add( textbox1 )
tbList.Add( textbox2 )
. . .
End Sub
Sub Button1_Click( ... ) Handles Button1.Click
For Each tb as TextBox in tbList
tb.Text = ""
Next
' or, from your example
For iSub as Integer = 0 To tbList.Count - 1
tbList( iSub ).Text = iSub.ToString()
Next
End Sub
HTH,
Phill W.