[Solved] How can i clear multiple text boxes when backspace is pressed?

[ad_1]

Try this:

txtUser.KeyPress += ClearTextboxes;
txtPass.KeyPress += ClearTextboxes;

private void ClearTextboxes(object sender, KeyPressEventArgs e)
{
    if (e.KeyCode == Keys.Back) 
    {
        (TextBox)sender.Text = string.Empty();
    }
}

[ad_2]

solved How can i clear multiple text boxes when backspace is pressed?