简体   繁体   English

禁用DevExpress XtraScrollableControl的鼠标滚轮滚动

[英]Disable mouse wheel scroll for DevExpress XtraScrollableControl

I dont want my XtraScrollableControl to scroll using mouse wheel. 我不希望我的XtraScrollableControl使用鼠标滚轮滚动。 But scroll should be enabled and visible and I should scroll XtraScrollableControl using mouse drag. 但是应该启用滚动并使其可见,并且我应该使用鼠标拖动来滚动XtraScrollableControl。 If i set 如果我设置

xtraScrollableControl1.AutoScroll = false;

the scroll bars are not visible anymore and if I set 滚动条不再可见,如果我设置

xtraScrollableControl1.FireScrollEventOnMouseWheel = true

then nothing happens.I am using DevExpress 13.2.5 那什么也没发生。我正在使用DevExpress 13.2.5

It looks like DevExpress may have a solution for this in their KB: 看来DevExpress可能在其知识库中提供了解决方案:

https://www.devexpress.com/Support/Center/Question/Details/K18512 https://www.devexpress.com/Support/Center/Question/Details/K18512

Take a look and see if that meets your needs. 看看是否满足您的需求。 I was going to try to replicate the problem and the suggested fix, but I can't figure out what a "Scrollable Control" is. 我打算尝试复制该问题和建议的修复程序,但无法弄清楚“ Scrollable Control”是什么。 Can you point me to that specific control? 您能指出我具体的控制方法吗?

It seems that the only way is to create XtraScrollableControl descendant and override its OnMouseWheelCore method with no code on it. 似乎唯一的方法是创建XtraScrollableControl后代,并在其上没有代码的情况下覆盖其OnMouseWheelCore方法。
Here is example: 这是示例:

public class NoMouseWheelControl : XtraScrollableControl
{
    protected override void OnMouseWheelCore(MouseEventArgs ev)
    {
        //No more wheel.
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM