C# .NET Textbox GotFocus Event
When one Googles to find out sample code for a C# .Net textbox gotFocus() event, the first few search results are not that explicit. So without further ado, here is a sample:
In the Form_Load method:
textBox2.GotFocus += new System.EventHandler(this.textBox2_GotFocus);
And then in the body of the form class you create this method:
private void textBox2_GotFocus(Object sender, EventArgs e)
{
// do something here
}
Hope this helps someone.
Subscribe to:
Post Comments (Atom)
Great example! very simple and powerful
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteGreat, thx :)
ReplyDelete