In your case, LostFocus in the text box use:
textBox1.Text = string.Format("{0:#,##0.00}", double.Parse(textBox1.Text));
Before applying the above logic, make sure the text is double / integer or it will throw an exception. This decision is quite tough, tough.
If you want the format to be in a certain culture, and not in the current computer culture,
textBox1.Text = string.Format(System.Globalization.CultureInfo.GetCultureInfo("id-ID"), "{0:#,##0.00}", double.Parse(textBox1.Text));
The above example is for Indonesia's currency format, in which a thousand separators use a period (".") Instead of a comma (",").
source share