Public Class Accueil Private x As Integer, y As Integer, n As Integer = 2 Private Sub bIni_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bIni.Click Initialiser() End Sub Private Sub bInc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bInc.Click Incrémenter() End Sub Private Sub Initialiser() x = 0 : y = 0 Afficher() End Sub Private Sub Incrémenter() If x = 3 Then x = 0 If y = n - 1 Then MessageBox.Show("ça va pas, la tête?") Else y = y + 1 End If Else x = x + 1 End If Afficher() End Sub Private Sub Afficher() MessageBox.Show("x = " & x.ToString & Environment.NewLine & "y = " & y.ToString) End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub bIni_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bIni.Click