Bonjour, j'ai dans ma forms un bouton "annuler". Quand j'appuie sur ce bouton, il efface tous les champs texte. Or j'ai une procédure textchanged qui est en conflit avec l'évènement du bouton "annuler". Comment faire pour corriger cela?![]()
Voici le code de l'évènement textchanged d'un textebox :
Voici le code du bouton "annuler" :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 Private Sub Txtrea1ertrim_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtrea1ertrim.TextChanged Txtrea1ertrim.Text = Txtrea1ertrim.Text.Replace(".", ",") Txtrea1ertrim.Select(Txtrea1ertrim.Text.Length, 0) If Txtrea1ertrim.Text = "" Then Txtrea1ertrim.Text = "" Dim c As [Decimal] = CDec(Txttotalrea.Text) Dim d As [Decimal] = CDec(Txtmontantc.Text) Txttotalrea.Text = "" Txtmontantpaye.Text = "" Txtresteapayer.Text = CDec(d) - CDec(c) Else Dim r As [Decimal] = CDec(Txtmontantc.Text) Dim res As [Decimal] = CDec(Txtrea1ertrim.Text) Txttotalrea.Text = CDec(res) Txtresteapayer.Text = CDec(r) - CDec(res) Txtmontantpaye.Text = CDec(Txttotalrea.Text) End If End Sub
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 Private Sub Btnannuler_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnannuler.Click Txtnumc.Text = "" Txtlibc.Text = "" Dates.Text = "" Datef.Text = "" Txtmontantc.Text = "" Txtrea1ertrim.Text = "" Txtre2emetrim.Text = "" Txtrea3emetrim.Text = "" Txtrea4emetrim.Text = "" Txttotalrea.Text = "" Txtmontantpaye.Text = "" Txtmodpay.Text = "" Txtresteapayer.Text = "" Optoui.Checked = True Optnon.Checked = False Txtmontantavance.Text = "" Cbxnumm.Text = "" Txtlibm.Text = "" Cbxfrs.Text = "" Txtnumfrs.Text = "" Txtdureec.Text = "" End Sub
Partager