Hi all
I have a small program.
For example: When I input data at textbox1.text="123456"
then textbox2.text will appear ="123.456"
How to solve.
Help me.
Printable View
Hi all
I have a small program.
For example: When I input data at textbox1.text="123456"
then textbox2.text will appear ="123.456"
How to solve.
Help me.
One of several ways:
Code:Private Sub Text1_KeyPress(KeyAscii As Integer)
Static intCount As Integer
Text2.Text = Text2.Text & Chr(KeyAscii)
intCount = intCount + 1
If intCount = 3 Then Text2.Text = Text2.Text & "."
End Sub
Thanks Doogle.
I mean that. If I have textbox1=12345678 then textbox2=12.345.678
It is the same Type of currency
Pleasev help me
I assume that '.' is your currency separator.
The easiest method might be to put some code in the LostFocus event of Text1
when you move the cursor out of Text1, Text2 should contain the formatted dataCode:Private Sub Text1_LostFocus()
Text2.Text = Format(Text1.Text, "##.###.###")
End Sub
You must use "," as thousand separator in Format() even your local thousand separator is "."
Code:Text2.Text = Format(Text1.Text, "#,##0")
Thank anhn very much