How do I restrict a user from entering multiple decimals into a text box in C#? The code below is my starting point:
if (System.Text.RegularExpressions.Regex.IsMatch(textBox1.Text, "[^0-9.]+")) {
MessageBox.Show("Please enter only numbers.");
textBox1.Text = textBox1.Text.Remove(textBox1.Text.Length - 1);
}