I have a borderless window and created the chrome but I need to disable the 'Alt+Space' shortcut. Any thoughts?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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);
}
}