public static void SpiltOnThird_TextChanged(object sender, EventArgs e) { TextBox txb = (TextBox)sender; txb.Text=numberSpiltOnThird(txb.Text); txb.Select(txb.Text.Length, 0); } public static string numberSpiltOnThird(string num) { if (num != ("0") & !string.IsNullOrEmpty(num)) { NumberFormatInfo nfi = new NumberFormatInfo(); num = num.Replace(",", ""); num = Convert.ToInt64(num).ToString(); nfi.NumberDecimalDigits = 0; return decimal.Parse(num).ToString("n", nfi); } else return ""; }
if (!char.IsNumber(e.KeyChar) && e.KeyChar.ToString() != "\b") { e.Handled = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)