Saturday, October 22, 2011

Select all text using ctrl + A in a TextField (multiline) C#

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 :)

Tuesday, October 4, 2011

Back again

Back again :)

After a long time I am back again and decided to post and write whatever I do. I will post basically technical terms in posts.....

Cheers 

PC Magazine Tips and Solutions

PC World: Latest Technology News

PCWorld.com - Most Popular Downloads of the Week