private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.Control && e.KeyCode == Keys.A) { ((TextBox)sender).SelectAll(); } }