Saturday, December 17, 2016

Celsius To Fahrenheit in Visual Basic NET

Here is a simple program that I wrote using Visual Basic NET to ask the user to give temperature in Celsius and then our program will convert the temperature given into Fahrenheit equivalent. I wrote this code before to Visual Basic 6 I try to migrate my codes into Visual Basic NET version. I hope you will find my work useful. Thank you.

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_fahrenheit As Double
        compute_fahrenheit = (9 / 5) * (Val(TextBox1.Text) + 32)
        Label2.Text = "The Fahreneheit is " & Format(compute_fahrenheit, "0.00")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label2.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 = ""
            Label2.Text = ""
            TextBox1.Focus()
        End If
    End Sub
End Class





No comments:

Post a Comment