در رویداد TextChanged مربوط به editbox به صورت زیر عمل کنید:
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Length > 0)
{
string text = textBox1.Text.Replace(",", "");
double value;
if (double.TryParse(text, out value) || text.EndsWith("."))
{
textBox1.TextChanged -= textBox1_TextChanged;
if (text.EndsWith("."))
textBox1.Text = string.Format("{0:#,##0.##}.", value);
else
textBox1.Text = string.Format("{0:#,##0.##}", value);
textBox1.SelectionStart = textBox1.Text.Length;
textBox1.TextChanged += textBox1_TextChanged;
}
}
}