Sinsitrus
Messages postés849Date d'inscriptionsamedi 11 juin 2005StatutMembreDernière intervention21 août 2015
-
26 août 2014 à 14:20
Whismeril
Messages postés19027Date d'inscriptionmardi 11 mars 2003StatutContributeurDernière intervention24 avril 2024
-
26 août 2014 à 14:32
Bonjour à tous !
J'ai bidulé un bout de code pour avoir la fonction de séparateur de millier dans ma textebox que voici :
Private Sub TextBox6_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress
If Not ",.1234567890".Contains(e.KeyChar) And e.KeyChar <> vbBack Then e.KeyChar = Nothing
Dim Pos As Integer
Pos = TextBox6.SelectionStart
If e.KeyChar = "." Then
e.Handled = True
TextBox6.Text = TextBox6.Text.Insert(Pos, ",")
TextBox6.SelectionStart = Pos + 1
End If
End Sub
Private Sub TextBox6_LostFocus(sender As Object, e As System.EventArgs) Handles TextBox6.LostFocus
TextBox6.Text = Format(TextBox6.Text, "Standard")
End Sub
Qu'en pensez-vous et comment je peut améliorer ce code svp ?
Merci d'avance !
----------
J'ai débuté VB10 depuis le 25/08/2014
OS : Windows 7 Pro 64 Bit
Plateforme : Visual Studio 2010