Search


Saturday, June 13, 2009

Shortcut key for select all on textbox (ctrl+A) in C Sharp

   1: private void anyTextBox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) 
   2: { 
   3:     if (e.KeyChar == '\x1') 
   4:     { 
   5:         ((TextBox)sender).SelectAll(); 
   6:         e.Handled = true; 
   7:     } 
   8: }

No comments:

Post a Comment