I'm using Visual Basic 2010 Express. When I add a NumericUpDown control to a form, the properties listing for events is not showing a MouseMove event. I know that it exists and I can use AddHandler to create a working handler for it, but it just doesn't show up. It doesn't it show up in the intellisense listing either.
Is there a way to "refresh" the Visual Studio so that it's included?
From the source code of the UpDownBase control from which it inherits from:
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
public new event MouseEventHandler MouseMove
Microsoft decided not to make it public. The reason being, I would guess, is that it just doesn't make sense to do anything with a MouseMove event on that control. It is a composite control comprised of a TextBox and some buttons.
If exposing that event is important, you would have to inherit from the NumericUpDown control and expose the event yourself:
public class MyUpDown : NumericUpDown {
[Browsable(true)]
[EditorBrowsable(EditorBrowsableState.Always)]
public new event MouseEventHandler MouseMove {
add { base.MouseMove += value; }
remove { base.MouseMove -= value; }
}
}
And the VB.Net version:
Public Class MyUpDown
Inherits NumericUpDown
<Browsable(True)> _
<EditorBrowsable(EditorBrowsableState.Always)> _
Public Shadows Event MouseMove(sender As Object, e As MouseEventArgs)
Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
MyBase.OnMouseMove(e)
RaiseEvent MouseMove(Me, e)
End Sub
End Class