I have a code that only allows numbers, comma and backspace to be entered in a textbox. But at the same time, I cannot insert text via ctrl + v. How can I do this?
private void textBox_KeyPress(object sender, KeyPressEventArgs e)
{
char number = e.KeyChar;
if ((e.KeyChar <= 47 || e.KeyChar >= 58) && number != 8 && number != 44)
{
e.Handled = true;
}
}