Results 1 to 2 of 2

Thread: UpDown Control Question

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    2

    Post

    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


  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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:

    Code:
    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



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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width