This is quite simple .... just add the keyDown event like below:
this.txtField.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtField_KeyDown);
You should add this event for those textfield only where you want to add this functionality ... Now just add below simple code and enjoy select all feature :D
private void txtField_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && (e.KeyCode == Keys.A))
{
((TextBox)sender).SelectAll();
e.SuppressKeyPress = true;
e.Handled = true;
}
}
Try and enjoy :)
Saturday, October 22, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment