Click here to Skip to main content
Click here to Skip to main content
Alternative Tip/Trick

Implementing shortcut keys for toolstrip

, 23 Aug 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
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;

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

KenBonny
Student Univeristy of Antwerp
Belgium Belgium
No Biography provided

Comments and Discussions

 
GeneralReason for my vote of 2 You can't assign a toolbar button to... PinmemberArmando de la Torre7-Sep-11 14:27 
GeneralRe: Aah, didn't know that. Thought any button would do. Thanks f... PinmemberKenBonny7-Sep-11 20:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.141022.1 | Last Updated 23 Aug 2011
Article Copyright 2011 by KenBonny
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid