I have a borderless window and created the chrome but I need to disable the 'Alt+Space' shortcut. Any thoughts?
WPF: How do I disable the SystemMenu shortcut 'Alt+Space'?
Asked Answered
Keep in mind that it's very bad practise to disable system shortcuts. I would personally uninstall an application that tried to mess with Alt-Space. Just an FYI. –
Mikemikel
Thanks Richard but I was handling system shortcut to implement it myself. Same keys, added functionality. –
Frown
I'm not very good with WPF, but after some messing around, this seems to be on the right track. Just throw it in your Window code-behind:
protected override void OnKeyDown(KeyEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Alt && e.SystemKey == Key.Space)
{
e.Handled = true;
}
else
{
base.OnKeyDown(e);
}
}
Thanks Cory. I just spent 6 hours sizing and moving a borderless form with KeyDown (arrows & Ctrl, etc). You'd think this would occur to me?!? :-) Thanks again. –
Frown
© 2022 - 2024 — McMap. All rights reserved.