In C# with .Net 4.5, disabled NumericUpDown
and ComboBox
controls still respond to mousewheel events. This seems like a bug.
Is this a bug in WinForms? Short of subclassing the controls, how can I prevent this from happening?
[Edit: reproduction steps] Using Visual Studio Professional 2012 Update 4 on Windows 10, I do the following:
Double click the checkbox to create an event handler:
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
panel1.Enabled = !checkBox1.Checked;
}
Compile and run. Hit the checkbox so that panel1.Enabled is false, then mouse over the NumericUpDown and move the mouse wheel. The numbers change even though the NumericUpDown is drawn disabled.
After attempting to reproduce this on a colleague's system, we determined that the problem was caused by a third party tool that I have installed to enable scrolling the window under the mouse pointer without that window requiring focus (a la OSX).