Alors voici la correction,
je t'ai inversé le tout, et fait en sorte que le curseur se place toujours avant le sigle Dollar :
Private Sub TextBox1_Change()
Dim MaVal As String
On Local Error Resume Next
MaVal = TextBox1.Text
If Not Right(MaVal, 1) = "$" Then
TextBox1.Text = MaVal & "$"
Else
If Not Right(Mid(MaVal, 1, Len(MaVal)
- 1), 1) = "." Then
TextBox1.Text = Round(CDbl(Mid(MaVal,
1, Len(MaVal) - 1)), 2) & "$"
End If
End If
TextBox1.SelStart = Len(TextBox1.Text) - 1
End Sub
~ <small>[code.aspx?ID=39466 Mortalino] ~
Colorisation automatique</small>
@++
<hr size="2" width="100%" />
--Mortalino--
Le mystérieux chevalier, "Provençal, le Gaulois"
<!--