我希望在滚动NumericUpDown时触发事件。当我在NumericUpDown中时,这段代码似乎忽略了滚动:
public Form1()
{
InitializeComponent();
MouseWheel += new MouseEventHandler(mousewheel);
}
void mousewheel(object sender, MouseEventArgs e)
{
System.Windows.Forms.MessageBox.Show("message");
}
答案 0 :(得分:1)
public Form1()
{
InitializeComponent();
numericUpDown1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.numericUpDown1_MouseWheel);
}
private void numericUpDown1_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
{
MessageBox.Show("hello");
}