Public Class FrmIsc3

    Private Sub FrmIsc3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TmrCaR.Start()
        LblCaR.Tag = 60 + 15
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdAnnul.Click
        Me.Close()
        FrmAccueil.Show()
        TmrCaR.Stop()
    End Sub

    Private Sub TmrCaR_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TmrCaR.Tick
        LblCaR.Tag -= 1
        If LblCaR.Tag <= 1 Then
            LblCaR.Text = "Vous disposez de " & LblCaR.Tag & " seconde restante."
        End If
        If LblCaR.Tag > 61 Then
            LblCaR.Text = "Vous disposez d'une minute et " & LblCaR.Tag - 60 & " secondes restantes."
        End If
        If LblCaR.Tag = 61 Then
            LblCaR.Text = "Vous disposez d'une minute et " & LblCaR.Tag - 60 & " seconde restante."
        End If
        If LblCaR.Tag <= 60 And LblCaR.Tag <> 1 Then
            LblCaR.Text = "Vous disposez de " & LblCaR.Tag & " secondes restantes."
        End If
        If LblCaR.Tag <= 10 Then
            LblCaR.ForeColor = Color.Red
        End If
        If LblCaR.Tag <= 0 Then
            TmrCaR.Stop()
            LblCaR.Text = "Le temps impartie est écoulée."
            MsgBox("Le temps impartie est écoulé. L'inscription a échoué.", MsgBoxStyle.Exclamation, "Echec")
            End
        End If
    End Sub

    Private Sub CmdNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdNext.Click
        TmrCaR.Stop()
        Me.Hide()
        FrmIsc4.Show()
    End Sub
End Class