Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF: How do I disable the SystemMenu shortcut 'Alt+Space'?

I have a borderless window and created the chrome but I need to disable the 'Alt+Space' shortcut. Any thoughts?

like image 890
Brad Avatar asked Feb 16 '10 22:02

Brad


1 Answers

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);
        }
    }
like image 101
Cᴏʀʏ Avatar answered Oct 01 '22 19:10

Cᴏʀʏ