|
Author: Jenny Nguyen
|
|
You may want part of you windows form to act as an accept button. For example you currently have your mouse focus on a textbox and upon user press Enter you want your application to execute a task as if they are clicking on the button to carry out the task. In .NET Winform you can use the AcceptButton property of the form to do this but what if you want to have this functionality on a number of different textbox on the same form. Well you could trap the Enter key on KeyDown, KeyUp or KeyPress event of the TextBox. Then from the event defintion check if the key press is key 13 then do something. { if (e.KeyValue == 13) { SearchFuncLoc(); } }
|