Formating in a text box

I have this problem. I write a financial software for an italian firm. In Italy thay have big numbers and they are used to put points to delimitate the number. Like: 1.000.000 is one million. Now..I have to write a routine that automatically formats the number to that format. I implemented a format routine that formats after I leave the text-box (in LostFocus event), but the client wants the formating to appera as he types the number. That is, when he typed the fourth digit a point to appear automatically.  
I tried to do this but I was unable to. Is it posible? And how?
Who is Participating?
SiM99Connect With a Mentor Commented:
Using the VB function Format() on Text1_Change will work....

Text1.Text=Format(Text1.Text, "#,###,###")
Text1.SelStart = Len(Text1.Text)

This solution will also work for bigger numbers (e.g. it will change 100000000
to 100,000,000)
Have you tried the masked edit box? It's a M$ product so it ought to be installed with VB. Check the Components window.
AzmodanAuthor Commented:
yeah...i seem to have overlooked that.
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

MaskEdit.Mask = "#.###.###.###"
Wonderful little thing...saves pages of if's and other jumbled code.
a 'C', ouch
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.