Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目前我可以使用右键单击进行缩放。有没有一种简单的方法可以用鼠标滚动来做到这一点?
谢谢。
尝试这样的事情:
protected override void OnPreviewMouseWheel(MouseWheelEventArgs e) { base.OnPreviewMouseWheel(e); if(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) { yourObject.Value += (e.Delta > 0) ? 0.2 : -0.2; }