I have a event which doesn’t give a any opportunity to input data in TextBox. When I’m trying to input data in Textbox, then Textbox doesn’t give to do it:
private void Login_textbox_KeyPress(object sender, KeyPressEventArgs e)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(textbox1.Text, @"^[a-zA-Z]+$"))
e.Handled = true;
}
I just want to input data in TextBox which isn’t digit or any symbols.
Try using the following code
Thanks!