Flowlayout面板禁用鼠标中轮滚动

时间:2014-04-25 19:49:32

标签: c#

我想阻止Middle Mouse Wheel滚动FlowlayoutPanel

我尝试了但没有(为什么不知道)

flowLayoutPanel.MouseWheel += (sender, args) => 
    ((HandledMouseEventArgs)args).Handled = true;

1 个答案:

答案 0 :(得分:1)

我认为你必须自己继承控制并注释掉基本调用:

public class FlowPanel : FlowLayoutPanel {
  protected override void OnMouseWheel(MouseEventArgs e) {
    // base.OnMouseWheel(e);
  }
}