WPF:判断Control+Z的组合键
if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.Z)
{
//处理逻辑
}
WinForm:判断Control+Z的组合键
if (e.Modifiers.CompareTo(Keys.Control) == 0 && e.KeyCode == Keys.Z)
{
//处理逻辑
}
WPF:判断Control+Z的组合键
if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.Z)
{
//处理逻辑
}
WinForm:判断Control+Z的组合键
if (e.Modifiers.CompareTo(Keys.Control) == 0 && e.KeyCode == Keys.Z)
{
//处理逻辑
}