954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VB Metric Standard Conversions

hey im trying to create a program that will convert between metric and standard units.I chose length as my measurement so i have nanometer,millimeter,centimeter,meter,hectometer,kilometer,inc,feet,yard and mile.
i wanted the inpu to be
- number to be converted(text box)
-unit number is in(combo box)
-unit to convert to(combo box)
i know how to do combo boxes,buttons and labels and stuff.
The output is the converted number this is what i have so far but its soooo wrong please help meeeeeeee:(

Public Class Form1

    Private Sub Convert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Convert.Click
        Dim Inch, Feet, Yard, Mile As Integer
        Dim Nanometer, Millimeter, Centimeter, Meter, Hectometer, Kilometer As Double

        Mile = CInt(Text)
        Yard = CInt(Text)
        Feet = CInt(Text)
        Inch = 63360 * Mile + 36 * Yard + 12 * Feet + Inch
        Meter = (Inch / 39.37)
        Kilometer = (Meter / 1000)
        Nanometer = (Meter * 1000000000)
        Millimeter = (Meter * 10000)
        Centimeter = (Meter * 100)
        Hectometer=(Meter/100)





    End Sub
End Class
diamondw
Newbie Poster
18 posts since Sep 2011
Reputation Points: 10
Solved Threads: 1
 

Please take the time to ask a coherent question. If you can't be bothered to explaini it properly then don't expect a coherent answer. For example i wanted the inpu to be
- number to be converted(text box)
I presume this means "The number to be converted is input by the user in a textbox". Put a little more effort into the question.

Reverend Jim
Posting Shark
Moderator
1,169 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159
 

No it means what I said.the number that will be converted(let's say 7)will be in a text box while the units its in will be in one combo box(let's say mm) and the units it will be converted to say m will be in another combo box.

diamondw
Newbie Poster
18 posts since Sep 2011
Reputation Points: 10
Solved Threads: 1
 

And how is "The number to be converted is input by the user in a textbox" different fromthe number that will be converted(let's say 7)will be in a text box

Reverend Jim
Posting Shark
Moderator
1,169 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159
 

No difference.I was explaining it more since you didn't seem to understand.

diamondw
Newbie Poster
18 posts since Sep 2011
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You