De vb6 à vb.net TextBox indexé
Salut à tous!
Je cherche à choisir un de mes 30 textbox nommé comme suit
TextBox1,TextBox2...etc
Voici un bout de code vb6 qui marche avec des TextBox(index) ou index = 1 to 30
Code:
1 2 3 4 5
| Case 0
For i = 0 To 9
If Text7(i).Text = "" Then Exit Sub
Text7(i).Text = Hex(Left(Val(Text7(i).Text), 2)) & Hex(Right(Val(Text7(i).Text), 2))
Next |
voici en vb.net ma nouvelle approche qui ne marche pas!
Code:
1 2 3 4 5 6 7 8 9 10
| For i = 0 To 9
If Controls("TextBox" & i.ToString).Text = Nothing Then
Controls("TextBox" & i.ToString).Text = "0000"
Else
ques-ce qui ne vas pas avec ceci
If Controls("TextBox" & i.ToString).Text = Nothing Then
ou
If Controls("TextBox" & i.ToString).Text = "" Then
suite du code
endif |