Showing posts with label inches to centimeter in visual basic net. Show all posts
Showing posts with label inches to centimeter in visual basic net. Show all posts

Saturday, December 17, 2016

Inches To Centimeter Converter in Visual Basic NET

In this simple program it will ask the user to give value in inches and then our program will convert the given value into centimeters equivalent using Microsoft Visual Basic NET. The code is design for beginners like me in Visual Basic NET programming.

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

My email address are the following 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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim compute_centimeter As Double
        compute_centimeter = (Val(TextBox1.Text) * 2.54)
        Label4.Text = "The Centimeter Equivalent is " & Format(compute_centimeter, "0.00")
    End Sub

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

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim result As DialogResult = MessageBox.Show("Do you want to quit?", _
                               "Quit Program", _
                               MessageBoxButtons.YesNo)

        If (result = DialogResult.Yes) Then
            End
        Else
            TextBox1.Text = ""
            Label4.Text = ""
            TextBox1.Focus()
        End If
    End Sub

    
End Class