Boucle Do Programme bloque
Bonjour,
Quand je fais un boucle Do mon programme reste comme bloquer alors que j'aimerais qu'il montre dans un textBox les incremantation de mes deux variable et un que le boucle Do puisse se stopper quand je click sur un bouton.
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Dim Aux As String
Dim Sortir As Boolean = False
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
Dim i, j As Integer
i = 0
Do
j = 0
Do
Aux = "Valeur de I " & i & " Valueur de J " & j
j = j + 1
Loop Until j = 100000 Or Sortir = True
i = i + 1
Loop Until i = 100000 Or Sortir = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TextBox1.Text = TextBox1.Text & vbCr & Aux
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Sortir = True
End Sub |
D'avance merci