开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜