Results 1 to 5 of 5

Thread: [RESOLVED] Easy Conversions? (e.g. Millimeters to Inches)

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    13

    Resolved [RESOLVED] Easy Conversions? (e.g. Millimeters to Inches)

    Hi, I'm just wondering (this is SO noobish of me) if there is an easy way to convert units. Up until now, I have inserted a combobox, and, depending on what's in it, converted something in a textbox (numeric value). For example:
    Code:
    Sub ConvertButton_Click(blah blah blah blah) Handles ConvertButton_Click 
     Dim conversionanswer As Double
      If combobox1.Text = "Feet to inches" Then
          conversionanswer = textbox1.text * 12
      ElseIf combobox1.Text = "Millimeters to inches" Then
          conversionanswer = textbox1.text * 0.4
      EndIf
      label1.Text = conversionanswer
    End Sub
    Something akin to that (I know, sloppy code that probably doesn't work .) I'm looking for something like two comboxboxes each with a unit and a textbox for number of units with a "Convert!" button. Can anyone help? Thanks!

    (EDIT: Is this the right section? My app is for Windows Mobile, but this is conceptual VB...)
    Last edited by winallsys; May 17th, 2009 at 05:03 PM. Reason: another question

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