Sub EditText1_TextChanged (Old As String, New As String)
EditText1.Text= NumberFormat(EditText1.Text,1,0)
EditText1.SelectionStart =EditText1.Text.Length
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
EditText1.Text= NumberFormat(EditText1.Text,1,0)
--------------
EditText1.SelectionStart =EditText1.Text.Length
End Sub
EditText2.Text = NumberFormat (EditText1.Text, 1,0)
--------------
EditText2.text => automatically as you enter here for 1,000 will be marked this way.
But ...
EditText1.text => This error will leave
--------------
I still think that changing EditText1.Text in the EditText1_TextChanged sub is leading to an infinite loop, which is why I suggested using the EditText1_EnterPressed sub.
Good way to teach us.
But ...
I want real change.
I would like to change the moment you enter.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Speak English and I'm sorry.. ^ ^
Sub EditText1_TextChanged (Old As String, New As String)
If NumberFormat (Old.Replace (",","") ,1,0) = New Then Return
EditText1.Text= NumberFormat(EditText1.Text.Replace (",",""),1,0)
EditText1.SelectionStart =EditText1.Text.Length
End Sub
To go through it:
First we check if there has been any changes, if not return. This avoids the infinite loop.
Then we format the number in the box to have ","
The ".Replace (",","") " is needed because when the editbox has a number with a "," in it, it does not convert to a number so we need to remove them, convert to a number then replace them!