MouseWheel 处理程序无法使用我的 .NET 2 表单处理 MouseEvent
我想成为使用鼠标滚轮滚动文档的早期采用者,尽管表单设计器没有发布 onMouseWheel
属性,但我已经在 之后以编程方式在我的 ctor 中配置了处理程序>InitializeComponent();
- 因为我没有那么大胆去搞乱它。
Form1() {
InitializeComponent();
this->MouseWheel += gcnew MouseEventHandler(this, &Form1::Form1_MouseWheel);
//stuff
}
我可以困在那里,但我不能困在处理程序本身中。还有其他人遇到这个问题吗?我在 VS2008 上使用 Synaptics 触摸板和 .NET 2.0(为了向后兼容)。当光标变为滚动状态但屏幕上没有发生进一步操作时。
C# 中的答案同样受到赞赏。谢谢。
I'd like to be an early adopter of using the mouse wheel to scroll my document and although the Forms designer doesn't publish the onMouseWheel
property I have configured the handler programmatically in my ctor just after InitializeComponent();
- 'cos I'm not so bold as to mess with that.
Form1() {
InitializeComponent();
this->MouseWheel += gcnew MouseEventHandler(this, &Form1::Form1_MouseWheel);
//stuff
}
I'm trapping there okay but I can't trap in the handler itself. Anyone else get this problem? I'm using a Synaptics touchpad and .NET 2.0 on VS2008 (for backwards compatibility). The cursor changes to the rolling wheen but no further action occurs on screen.
Answers in C# are equally appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
向 鼠标滚轮事件 (C#) ?这就是我的答案,尽管在本例中是文本框从表单中获取了焦点并捕获了其鼠标滚轮事件。
我想我不应该问原来的问题,也许这会帮助其他人不必问。
Would it be bad form to add a belated comment to Mouse Wheel Event (C#) ? There lies my answer, although in this case it was the textbos which had taken the focus from the Form and captured its mousewheel event.
I suppose I shouldn't have asked the original question, maybe it will help others not have to.