Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

"Drink wet cement and get really stoned"
  • *Experts*
Posted

If I understand correctly, you want to set the minimum value for

NUD1 to 1. To do this, set its Minimum property to 1.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted

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

"Drink wet cement and get really stoned"
  • *Experts*
Posted

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

 

NumericUpDown1.Value = +1

 

... you are setting the value to positive one. This is different than

using the addition assignment operator, which is +=, like so:

 

NumericUpDown1.Value += 1

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...