我怎么能写这种情况发生时,鼠标滚动文本框在一个事件? [英] How can I Write an Event that Happens when Mouse Scrolls in TextBox?

查看:138
本文介绍了我怎么能写这种情况发生时,鼠标滚动文本框在一个事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变文本框时,鼠标滚动的数量。我有一个滚动文本框,但我不想要使用。是否有与此相关的任何事件?
我应该写一个文本框的事件?如果是的话,我怎么能写偏偏一个TextBox事件时,鼠标滚动?

I wanna change the number of the TextBox when The Mouse Scrolls. I have a Scroll TextBox But I Don't wanna use that. Is There any Event related to this? Should I write an TextBox Event? If yes, How can I write a textBox event that Happens when Mouse Scrolls?

推荐答案

鼠标滚轮事件是有正常的:

public Form1()
{
    InitializeComponent();
    textBox1.MouseWheel += textBox1_MouseWheel;
}

void textBox1_MouseWheel(object sender, MouseEventArgs e)
{
    throw new NotImplementedException();
}



但它不是在事件编辑器是可见的。不知道为什么。

But it is not visible in the event editor. No idea why..

您可以通过智能感知这样找到事件的完整名单:

You can find the full list of events through Intellisense like this:

输入控件的名称和一个圆点。现在看您需要的事件DropDownList的。当你写 + = 添加按设置页的两倍。这挂接事件,并为它的存根。

Enter the Control's name and a dot. Now watch the dropdownlist for the event you need. When you have it write += add press Tab twice. This hooks up the event and creates a stub for it.

这篇关于我怎么能写这种情况发生时,鼠标滚动文本框在一个事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆