A straightforward Visual Basic Windows Forms program that asks the user for a temperature in Celsius, converts it to Fahrenheit using F = C * 1.8 + 32, logs both values into list boxes, and displays the converted result in a message box.
Full Visual Basic Code
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim celsius As Single ' creates the celsius variable
Dim fahrenheit As Single ' creates the fahrenheit variable
celsius = InputBox("What's the temperature in Celsius?") ' asks for the degrees in celsius
fahrenheit = celsius * 1.8 + 32 ' mathematical equation for celsius to fahrenheit
ListBox1.Items.Add(celsius) ' adds the degrees in celsius to your first listbox
ListBox2.Items.Add(fahrenheit) ' adds the degrees in fahrenheit to your second listbox
MsgBox("The temperature converted to fahrenheit is " & fahrenheit) ' displays the result
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
End ' emergency end program button
End Sub
End Class
Step-by-Step Guide
- Open Visual Studio and create a new Visual Basic Windows Forms Application.
- Drag and drop two Label controls onto the form and name them
CelsiusandFahrenheit. - Drag and drop two ListBox (or display) controls onto the form to display both temperature columns.
- Drag and drop two Button controls onto the form and label them Start and End.
- Double-click both the Start button and the End button to open their click event handlers in the Code Editor.
- Add the code below into each handler (the lines to add are marked in red in the screenshots).
"End" Button Code

Below the Start button's handler, you'll see the Button2_Click block shown above. Add End inside it (without parentheses) — that's all you need for the End button to close the program.
"Start" Button Code

Inside Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click, declare the celsius and fahrenheit variables, read the Celsius input, calculate celsius * 1.8 + 32, and output the values to both list boxes and the MsgBox.