forum

home / developersection / forums / catch keyup event on winform c#

Catch KeyUp Event on WinForm C#

Anonymous User 3266 04-Sep-2013

I attempt to catch F5 on System.Windows.Forms for that I wrote:

partial class MainForm

{

   (...)

   this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyUp);

   (...)

}

public partial class MainForm : Form

{

    (...)

    private void MainForm_KeyUp(object sender, KeyEventArgs e)

    {

        Log("MainForm_KeyUp");

        if (e.KeyCode == Keys.F5)

        {

            RefreshStuff();

        }

    }

}

But my event catching looks not working.

Do you know how to cactch EventKey on System.Windows.Forms ?


c# c# 
Updated on 04-Sep-2013

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By