and also knowing once it is fired whether it is an up click or a down click
OtherFunction()
UpDown1_DownClick(UpDown1, New System.EventArgs())
Dim iUpDownValue As Integer
Dim iPrevUpDownValue As Integer = 0 Private Sub UpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDown1.ValueChangediUpDownValue = UpDown1.Value
If iUpDownValue > iPrevUpDownValue Then 'Upclick Else 'DownclickEnd If
End Sub
Thank you,
-Greg

firing numericupdown event from another function
flash.tato
Syed Junaid
Vhradice
Hi,
I had to re-read as i started thinking about mouse event arguments. As in mouse button up or down.
To FIRE from another function use.>>
NumericUpDown1.UpButton() ' or
NumericUpDown1.DownButton()
Anyway the following code doesn't work in the Value_Changed Sub for some unknown reason in that event it takes two clicks on a control arrow to change the textbox1 content. [EDIT : ] I've just realised the Value_Changed event is fired mostly when it is changed manually ( not with the arrow buttons ) as in Text_Changed for a textBox.Regards,
S_DS
__________________________________________________________________________________
Dim prevValue As Double = 0
Private Sub NumericUpDown1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NumericUpDown1.MouseDown
Dim myNum As Double
myNum =
CDbl(NumericUpDown1.Text) If myNum > prevValue ThenTextBox1.Text = "Number went up!!"
ElseIf myNum < prevValue ThenTextBox1.Text = "Number went down!!"
ElseIf myNum = prevValue Then 'You'll see this message only when you reach the MAXIMUM 'or MINIMUM value set in the control after another click of your mouse too.TextBox1.Text = "Number in the control hasn't changed!!"
End If
prevValue =
CDbl(NumericUpDown1.Text) End SubJohan Andersson
Hi,
Do you also need to know when the Maximum or Minimum values are reached and if the user is still clicking the mouse
Regards,
S_DS