Solved

How do I write code for the updown control??

Posted on 2000-03-12
2
144 Views
Last Modified: 2010-05-02
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
Comment
Question by:sf129
  • 2
2 Comments
 
LVL 9

Accepted Solution

by:
Ruchi earned 75 total points
ID: 2611119
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
 
LVL 9

Expert Comment

by:Ruchi
ID: 2611156
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now