Ctrl-A Shortcut To Select All Text (Windows.Forms.TextBox)
Join the DZone community and get the full member experience.
Join For FreeSet this event handler for your textbox to enable Ctrl-A shortcut and select all text:
private void anyTextBox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == '\x1')
{
((TextBox)sender).SelectAll();
e.Handled = true;
}
}
Opinions expressed by DZone contributors are their own.
Comments