Catch KeyUp Event on WinForm C# -


i attempt catch f5 on system.windows.forms 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 event catching looks not working.

do know how cactch eventkey on system.windows.forms ?

the keypreview property of form must set true

when property set true, form receive keypress, keydown, , keyup events. after form's event handlers have completed processing keystroke, keystroke assigned control focus.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -