2
在下面的代码中,两次调用Zoom(0.1f);
和Zoom(-0.1f);
工作,但我不能触发两个UndoRedoManager.Undo();
和UndoRedoManager.Redo();
呼吁CTRL +ž和 CTRL +ÿ。我究竟做错了什么?为什么不工作KeyDown CTRL + KEY?
public void WorkspaceKeyDown(KeyEventArgs e)
{
if (e.Control == true)
isCtrlPres = true;
if (e.Shift == true)
isShiftPres = true;
if (e.Control == true && e.KeyCode == Keys.Z)
{
UndoRedoManager.Undo();
}
else if (e.Control == true && e.KeyCode == Keys.Y)
{
UndoRedoManager.Redo();
}
else if (e.Control == true && e.KeyCode == Keys.Oemplus)
{
Zoom(0.1f);
}
else if (e.Control == true && e.KeyCode == Keys.OemMinus)
{
Zoom(-0.1f);
}
你问为什么'按Ctrl +'和'按Ctrl-'不认可? – 2011-05-23 18:56:37
@Rup非常好,我希望我可以upvote编辑。 – 2011-05-23 18:59:01
也许,错误的键盘布局?.. – vines 2011-05-23 19:07:22