Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

How do I write code for the updown control??

i need to write code using the updown control to increment or decrement a number.  The user enters a number in a textbox, then after the number is entered they have the option to increment the number or decrement it.  I got it to work for incrementing the number, the only problem is that when the down arrow is pressed it still increments the number.  Example: Private Sub UpDown2_Change()
 txtcentigrade.Text = txtcentigrade.Text + UpDown2.Increment
End Sub
I am hopeless, can anyone help me??
0
sf129
Asked:
sf129
  • 2
1 Solution
 
RuchiCommented:
try something like this..

Private Sub UpDown1_DownClick()
Text1.Text = Text1.Text - UpDown1.Increment
End Sub

Private Sub UpDown1_UpClick()
Text1.Text = Text1.Text + UpDown1.Increment
End Sub
0
 
RuchiCommented:
The UpDown control has the following three events--
1. Change - occurs any time the Value property of the control is changed.
2. DownClick - occurs when you click the down arrow of the control
3. UpClick - occurs when you click the up arrow of the control.

Hope this helps you.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now