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
Post a Comment