Plus de présisions.
Voici le code que j'ai fait :
Public Class Form1
Dim seconde = 15
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If e.CloseReason = CloseReason.UserClosing Then e.Cancel = True
Dim fenetre As New Form1
fenetre.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fenetre As New Form1
fenetre.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim fenetre As New Form1
fenetre.Show()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim fenetre As New Form1
fenetre.Show()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If seconde = True Then
Dim fenetre As New Form1
fenetre.Show()
seconde = 15
End If
Label2.Text = "Ce logiciel se reproduira dans " & seconde & " secondes."
If seconde = 1 Then
Label2.Text = "Ce logiciel se reproduira dans 1 seconde"
End If
seconde = seconde - 1
End Sub
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress )
If KeyPreview = "1" Then ) Le problème est la. Quand je tappe sur 1 sa fait comme
Me.Close() ) si je clic sur la croix, mais sa ne ferme pas le programme
End If )et sa ouvre une autre fenetre. Moi je voudrais que le
End Sub )programme s'arret.
End Class
Pourriez vous me dire quoi faire?
Merci.