【问题标题】:Why does pressing shift and scrolling forward fire the mouse click event为什么按shift和向前滚动会触发鼠标单击事件
【发布时间】:2014-03-12 02:42:46
【问题描述】:

我正在尝试使用滚轮增加列表视图控件中的值。当滚动时按住 shift 键时,我希望该值增加 10。按住 shift 键并向前滚动会触发 listviews mouseclick 事件。向后滚动不会。单击事件显示单击鼠标左键。这是设计使然吗?

【问题讨论】:

  • 你能用 e.handled = true;阻止鼠标点击事件?
  • 是的,这将在点击之前触发 wheel 事件(谢谢)。我仍然想知道这个事件触发的原因是什么。
  • 看来我的鼠标滚轮事件将 e 声明为 MouseEventArgs,并且没有 e.handled。你有如何使用它的代码示例吗?
  • 我已经提交了该问题的答案。我个人不知道为什么使用鼠标 weel + shift 会触发单击事件。我也想知道答案。

标签: c# visual-studio-2010


【解决方案1】:

在 MouseEventArgs 中使用 ((HandledMouseEventArgs)e).Handled = true; 来防止选择问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-30
    • 2019-10-21
    相关资源
    最近更新 更多