I have problem in VB
Im trying to create a program that will convert English to Metric System but it comes with error and can not display the result in RichTextBox.
Dim miles As Double
Dim yards As Double
Dim feet As Double
Dim inches As Double
Dim meters As Double
Dim kilometers As Double
Dim centimeters As Double
Dim totalInches As Doublemiles = CInt(txtMiles.Text)
yards = CInt(txtYards.Text)
feet = CInt(txtFeet.Text)
inches = CInt(txtInches.Text)
totalInches = 63360 * miles + 36 * yards + 12 * feet + inches
meters = (totalInches / 39.37)
kilometers = Int(meters / 1000)
centimeters = (meters / 100)kilometers = (totalInches / 39.37) / 1000
meters = (kilometers - Math.Floor(kilometers)) * 1000
centimeters = (meters - Math.Floor(meters)) * 100With DialogResult.
.Clear()
.Add("The metric length is:")
.Add(Math.Floor(kilometers) & " kilometers")
.Add(Math.Floor(meters) & " meters")
.Add(Math.Round(centimeters, 2) & " centimeters")
End WithWith lstDialogueResultsItems.
.Clear()
.Add("The metric length is:")
.Add(kilometers & " kilometers")
.Add(meters & " meters")
.Add(centimeters & " centimeters")
End WithEnd Sub
but it comes with error and can not display the result in RichTextBox.
And? What's the error? Where's the error?Is it in the With lines? Because you should remove the trailing period off those lines.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |