NumericUpDown

rosshodges

Freshman
Joined
Nov 23, 2002
Messages
28
I have the following code

Private Sub NumericUpDown2_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown2.ValueChanged
If NumericUpDown2.Value > 59 Then
NumericUpDown1.Value = +1
NumericUpDown2.Value = 0
End If

but it only makes NumericUpDown1 go up to 1 from 0 not from 1 to 2. I would like it to go like a timing device. So from 1 to 2 to 3 etc.

NumericUpDown2.Value = secs
NumericUpDown1.Value = minutes

Regards,

Ross
 
If I understand correctly, you want to set the minimum value for
NUD1 to 1. To do this, set its Minimum property to 1.
 
sorry to confuse you , its a countdown timer program. and the NumericUpDown boxs are the minutes seconds and hours . when the seconds get to 59 i want the minutes go to 1. i can do this with the code above but it only works from 59 secs to one min. not from 1min 59 until two and 2min 59 can anyone help i tried putting in (+1) instead of +1 but it gives and an error.

Regards,
Ross
 
Ah, I see your problem. In this line...

Visual Basic:
NumericUpDown1.Value = +1

... you are setting the value to positive one. This is different than
using the addition assignment operator, which is +=, like so:

Visual Basic:
NumericUpDown1.Value += 1
 
Back
Top