private void textBox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\x1') { ((TextBox)sender).SelectAll(); e.Handled = true; } }