SCROLL IN NUMERICUPDOWN

marcel ethan

Total Post:105

Points:735
Posted by  marcel ethan
C# 
C#
 1438  View(s)
Ratings:
Rate this:

I want to have an event triggered when I scroll in my NumericUpDown. This code seems to ignore the scrolling when I'm inside a NumericUpDown:

public Form1()

{

    InitializeComponent();

    MouseWheel += new MouseEventHandler(mousewheel);

}

void mousewheel(object sender, MouseEventArgs e)

{

    System.Windows.Forms.MessageBox.Show("message");

}

  1. Pravesh Singh

    Post:412

    Points:2888
    Re: Scroll in NumericUpDown

    Hi Marcel,

    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");

        }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!