Solved

How do I write code for the updown control??

Posted on 2000-03-12
2
146 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 76
Updates not working for MS Windows 7 12 166
How to Add / Edit Windows Menu 4 61
Protecting vb6 & .Net code Obfuscation 18 125
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

803 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