How can I fire a Button Click event when PageDown key pressed in c# winform
i write some code in a Button Click event,
private void sabt_btn_Click(object sender, EventArgs e) { some code.... }
i want fire this button action when PageDown" key is pressed in form.
开发者_高级运维private void myform_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.PageUp) { how to fire sabt_btn_Click } }
You should move that code to a separate method, then call that method from both event handlers.
精彩评论