Microsoft KB Archive/189808

= PRB: UpDown Control May Not Increment As Expected =

Article ID: 189808

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q189808



SYMPTOMS
When you click the up or down button on an UpDown control, you notice that the value changes by more than the amount specified for the Increment property. For example, if the Increment property is 2, the value of the UpDown control may change by 3 instead of 2.



CAUSE
When you click the up or down button to change the value of an UpDown control, the control will first "normalize" the current value before it is changed by the amount specified in the Increment property. By normalizing the value, the UpDown control may change by more than the amount specified in the Increment property so that the new value is evenly divisible by the Increment.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Start a new Standard EXE project. Form1 is created by default. Choose Components from the Project menu, check "Microsoft Windows Common Controls-2" and click OK. The UpDown control should now be available on the Toolbox. Add a Textbox control to Form1. Add an UpDown control to Form1.  Set the properties of the UpDown1 control as follows: BuddyControl = Text1 BuddyProperty = Text Increment = 2 Max = 13 Min = 3 Value = 3   Add the following code to the Form1 module: Option Explicit

Private Sub Form_Load Text1.Text = UpDown1.Min End Sub </li> Run the project. Form1 appears.</li> Click once on the up arrow of the UpDown control. Although the Increment property is 2, the value of the UpDown control changes from 3 to 6 rather than 3 to 5.</li></ol>

Additional query words: kbDSupport kbDSD kbVBp kbVBp500 kbCtrl kbVBp600

Keywords: kbprb KB189808

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.