PDA

Click to See Complete Forum and Search --> : UpDown Control Question


ktippetts
Nov 15th, 1999, 11:41 AM
Using VB 5.0 and some UpDown controls to set margins. As far as I can tell, I'm not allowed to set increment values less than 1 (like .25 or .33). So the question is, since I want to display the margin measurements in inches (such as .33", .34", .35" and so on) as the user clicks the up or down buttons, how do I do it?

Thanks
--ktippetts

Serge
Nov 15th, 1999, 05:54 PM
I think you still can do it (not to change the Value property though) Lets say you have a Textbox where you want to see your results. Here's a small exmple:


Private Sub Form_Load()
Text1.Text = 0
End Sub

Private Sub UpDown1_DownClick()
If CDbl(Text1.Text) = 0 Then Exit Sub
Text1.Text = Format(CDbl(Text1.Text) - 0.1, "0.0")
End Sub


Private Sub UpDown1_UpClick()
If CDbl(Text1.Text) > 100 Then Exit Sub 'Specify any maximum number here
Text1.Text = Format(CDbl(Text1.Text) + 0.1, "0.0")
End Sub




Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)



[This message has been edited by Serge (edited 11-16-1999).]