I have a textbox where the user enters a number, but how can i make it so that if they type the \'.\' after it it only allows 2 decimal places?
private void
Just add:
if (Regex.IsMatch(textBox1.Text, @"\.\d\d")) { e.Handled = true; }
to the end of your function