Martijn van Dru Posted August 25, 2003 Posted August 25, 2003 Hello When I have for example 2 textboxes: TextBox1 and Textbox2 Now is i an integer with the value 1 or 2. Which syntax I require to call: TextBoxi.Text Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click active(1) End Sub Private Sub active(ByVal i As Integer) TextBox & "i".Text = "Hello") End Sub Quote
*Experts* mutant Posted August 25, 2003 *Experts* Posted August 25, 2003 You need to go through all controls on the form and look for the textbox: Dim ctrl As Control For Each ctrl in Me.Controls If TypeOf ctrl Is TextBox Then If ctrl.Name = "TextBox" & i Then 'do something to that textbox End If End If Next Quote
Martijn van Dru Posted August 25, 2003 Author Posted August 25, 2003 Really, I hoped it could be done at ones, but that's not possible? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.