wpf_屏蔽按键

  重写此方法

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);
}
}

wpf_屏蔽按键

上一篇:Windows的cmd命令拷贝文件夹及子文件夹中的文件强制覆盖到指定目录


下一篇:wpf_写pdf