Sunday, April 10, 2016

Miles To Kilometers Converter in Visual Basic.NET

A very simple program that I wrote in Visual Basic.NET that will ask the user to give the distance in Miles and then our program will convert the given distance by the user in Miles to Kilometers.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label3.Visible = False
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Label3.Visible = True

        Dim Miles As Decimal

        Dim Kilometers As Decimal

        Miles = Val(TextBox1.Text)

        Kilometers = (Miles * 1.609344)

        Label3.Text = Miles & " Mile(s) is equivalent to " & Math.Round(Kilometers, 2) & " Kilometer(s)"


    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label3.Text = ""
        TextBox1.Focus()
    End Sub
End Class




No comments:

Post a Comment