重写此方法
protected override void OnKeyDown(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 if (Keyboard.Modifiers == ModifierKeys.Control && Keyboard.Modifiers == ModifierKeys.Shift&& e.SystemKey==Key.Escape)
{
e.Handled = true;
}
else
{
base.OnKeyDown(e);
}
}