Doubt in key event handler

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
Hai.
i want to trigger a buttons event using keyboard in WPF
i tried like this
Button name "Enter"


private void Enter_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
<span style="white-space:pre {
<span style="white-space:pre if(e.Key == Key.A)
<span style="white-space:pre {
<span style="white-space:pre MessageBox.Show("Entering");
<span style="white-space:pre }
<span style="white-space:pre }

My Problem is : event is not working by pressing "a" immediatly after opening the application.
first i have to click the button then only the Event is working for pressing keyboard key "a".

Please Help Me... Thank You

View the full article
 
Back
Top