private void PUAN_TextChanged(object sender, EventArgs e) { if (PUAN.Text != "") { PUAN.TextChanged -= new EventHandler(PUAN_TextChanged); if (PUAN.Text.Contains(",")) { if (Goto724Lib.AfterChr(PUAN.Text, ',').Length > 2) { PUAN.Text = puanLastText; PUAN.SelectionStart = PUAN.Text.Length; PUAN.TextChanged += new EventHandler(PUAN_TextChanged); return; } else if (Goto724Lib.BeforeChr(PUAN.Text, ',').Length == 0) { PUAN.Text = "0," + Goto724Lib.BeforeChr(PUAN.Text, ','); } else { double numeric = Convert.ToDouble(Goto724Lib.RemoveChar(Goto724Lib.BeforeChr(PUAN.Text, ','), '.')); PUAN.Text = numeric.ToString("#,0") + "," + Goto724Lib.AfterChr(PUAN.Text, ','); } } else { double doubleVal = Convert.ToDouble(Goto724Lib.RemoveChar(PUAN.Text, '.')); PUAN.Text = doubleVal.ToString("#,0"); } puanLastText = PUAN.Text; PUAN.SelectionStart = PUAN.Text.Length; PUAN.TextChanged += new EventHandler(PUAN_TextChanged); } }