Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. private void TextBoxEquation_TextChanging(TextBox sender, TextBoxTextChangingEventArgs args)
  2. {
  3. try
  4. {
  5. int selectionIndex = textBoxEquation.SelectionStart;
  6. string simpleNum = textBoxEquation.Text.Replace(",", "");
  7. var value = string.Format("{0:N0}", long.Parse(simpleNum));
  8. textBoxEquation.Text = value;
  9. textBoxEquation.SelectionStart = selectionIndex + 1;
  10. }
  11. catch { }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement