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 27 28 29 30 31 32 33
|
Private Sub Txtmontantavance_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtmontantavance.TextChanged
If annulation = True Then Exit Sub
Txtmontantavance.Text = Txtmontantavance.Text.Replace(".", ",")
Txtmontantavance.Select(Txtmontantavance.Text.Length, 0)
Try
If Txtmontantavance.Text = "" Then
Dim mc As [Decimal] = CDec(Txtmontantc.Text)
Dim total As [Decimal] = CDec(Txttotalrea.Text)
Dim ma As [Decimal] = CDec(Txtmontantavance.Text)
Txtmontantpaye.Text = CDec(Txttotalrea.Text)
Txtresteapayer.Text = CDec(Txtmontantc.Text) - CDec(Txttotalrea.Text)
Else
Dim mc As [Decimal] = CDec(Txtmontantc.Text)
Dim total As [Decimal] = CDec(Txttotalrea.Text)
Dim ma As [Decimal] = CDec(Txtmontantavance.Text)
Dim var As [Decimal]
var = total + ma
Txtmontantpaye.Text = total + ma
Txtresteapayer.Text = mc - (total + ma)
End If
Catch ex As Exception
End Try
If IsNumeric(Txtmontantavance.Text) Then
Exit Sub
ElseIf (Txtmontantavance.Text) = "" Then
Exit Sub
Else
MsgBox("Vous devez saisir une valeur monétaire", MsgBoxStyle.Critical + MsgBoxStyle.OkOnly)
Txtmontantavance.Text = ""
End If
End Sub |