Right now I am using this code which is clearing textboxes simultaneously i want to do it separately
private void metroTile13_Click(object sender, EventArgs e)
{
txtUser.Text = txtUser.Text.Remove(txtUser.Text.Length - 1, 1);
txtPass.Text = txtPass.Text.Remove(txtUser.Text.Length - 1, 1);
}
答案 0 :(得分:0)
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();
}
}