65.9K
CodeProject is changing. Read more.
Home

Implementing shortcut keys for toolstrip

starIconstarIconemptyStarIconemptyStarIconemptyStarIcon

2.00/5 (1 vote)

Aug 23, 2011

CPOL
viewsIcon

11510

This is nice for non standard buttons (like a CTRL + s), but OK and Cancel buttons have standard implementations in a Windows Form. Look for the properties AcceptButton and CancelButton of a Windows Form (not sure if this applies in ASP.NET or WPF, I need confirmation on that). There you can...

This is nice for non standard buttons (like a CTRL + s), but OK and Cancel buttons have standard implementations in a Windows Form. Look for the properties AcceptButton and CancelButton of a Windows Form (not sure if this applies in ASP.NET or WPF, I need confirmation on that). There you can specify a button to serve as a accept or cancel event. They will automatically be executed when the Enter and Esc keys are pressed and the form has focus. Or write:
AcceptButton = btnOk;
CancelButton = btnCancel;