/// <summary>
/// 阻止 alt+f4和alt+space 按键
/// </summary>
/// <param name="e"></param>
protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Alt && e.SystemKey == Key.Space)
{
e.Handled = true;
}
else if (Keyboard.Modifiers == ModifierKeys.Alt && e.SystemKey == Key.F4)
{
e.Handled = true;
}
else
{
base.OnKeyDown(e);
}
}
转载于:https://www.cnblogs.com/chlm/p/6382846.html