Dear All,
I have created one silverlight application.In the application i have included two buttons named as SAVE and CANCEL. I want to give short cut keys for those two controls.
For Example if user click CTRL+S it should save the data and CTRL+C it should cancel.
Thanks,

Rajesh Muraharisetty34 reputationPosted Aug 31, 2011, 12:50 AM EDT
Try this code once. I think it will work perfectly. public partial class MainPage : UserControl { private bool _CtrlPressed; public MainPage() { InitializeComponent(); LayoutRoot.KeyDown += new KeyEventHandler(LayoutRoot_KeyDown); LayoutRoot.KeyUp += new KeyEventHandler(LayoutRoot_KeyUp); } void LayoutRoot_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Ctrl) _CtrlPressed = true; } void LayoutRoot_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Ctrl) _CtrlPressed = false; if (e.Key == Key.S && _CtrlPressed) { Debug.WriteLine("Ctrl + S was pressed"); //Execute save operation } } } Thanks& Regards, Rajesh M.