top of page

OOP Language : Celsius and Fahrenheit Conversion

100 degrees Celsius = 212 degrees Fahrenheit

Visual Basic 2013 Adobe-40.jpg

Visual Basic - An Event Driven Programming Language

Building the GUI-Based Programming Language

by Inserting Controls from the Tool Box.

1. Right Click on Graphics Image : Then Press Save Image as to Folder

      - The Graphics Chart below corresponds to the Tool Box Controls

      - Making Graphic User Interface [GUI] Easier to Build.

2. Copy Coding onto Forms VB for Program Execution.

3. In VB Design Mode : Drag Picture Box from Tool Box.

4. Set Picture Box Size Mode to Stretch Image.

         In Forms Design Mode - Properties set Size to (1069,805)

         In PictureBox Properties - Set Size to (1012,726)

 

5. Download Graphic Image below from allocated Folder.

In Private Sub Button_1 if only 1 Form is being used.

Terminate Form9.Show()

               Me.Hide()

Then add  Me.Close()  ' To Close Program.

Follow and Insert the TextBox, LabelBox and Button Controls from ToolBox

and allocate them on the Graphics.

The Program alternatively Converts Celsius to Fahrenheit & Fahrenheit to Celsius.

      

Public Class Form14

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


        Form9.Show()
        Me.Hide()


    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        'Dimension Variable as Single Precision Accuracy.
        Dim Fahrenheit As Single
        Dim Celsius As Single
        Dim Celconvert As Single
        Dim Fahconvert As Single

        'Celsius to Fahrenheit Conversion
        Fahrenheit = TextBox1.Text
        Celconvert = ((Fahrenheit - 32) * (5 / 9))

        'Fahrenheit to Celsius Conversion
        Celsius = TextBox2.Text
        Fahconvert = ((Celsius * (9 / 5)) + 32)

        'Assign Computational Conversion to Labels
        Label1.Text = Celconvert
       
Label2.Text = Fahconvert


    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

        'Clear TextBox & Labels for Re-Calculus
        TextBox1.Text = ""
       
TextBox2.Text = ""
       
Label1.Text = ""
       
Label2.Text = ""

    End Sub


End Class

bottom of page