I am trying to subclass NumericUpDown in several ways to improve functionality and appearance.
Since NUD is the construction of two controls, I would like to hide the up / down buttons in cases where the "Increment" property is set to 0.
This code is in a subclass:
Protected Overrides Sub OnTextBoxResize(ByVal source As Object, ByVal e As System.EventArgs)
Controls(0).Hide()
End Sub
... and it works fine. But in this function, I cannot check the value of the Increment property as follows:
Protected Overrides Sub OnTextBoxResize(ByVal source As Object, ByVal e As System.EventArgs)
If Me.Increment = 0 Then
Controls(0).Hide()
End if
End Sub
Me is not available under this feature. I am also trying to use local variables, but I cannot find which event will be fired before OnTextBoxResize to read the value of the Increment property.
What to do in this case to get the desired functionality?