Remove predefine shortcut key
how can i remove predefine shortcut keys of keyboard by C# coding in wpf
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted May 26, 2011, 6:51 AM EDT
private void Window_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.LeftAlt || e.Key == Key.RightAlt || e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl || e.Key == Key.RightShift || e.Key == Key.LeftShift)
{
//e.Handled = false;
return;
}
}
This will help you, when the user wants to press Control Key +A , it will do not anything.
In the If condiion, you add others keys windows button... etc.
Hope this helps you.
Sam HobbsRank #107 · 20.5K reputationPosted May 26, 2011, 2:16 PM EDT
krishna kumar dubey71 reputationPosted May 26, 2011, 10:22 PM EDT
Posted May 26, 2011, 11:02 PM EDT
If the Combination of Ctrl+A is pressed then just do return or do your own logic.