- Version
- Download 64
- File Size 254.57 KB
- File Count 1
- Create Date March 2, 2016
- Last Updated March 2, 2016
Celsius to Fahrenheit Converter in Visual Basic
Celsius to Fahrenheit Converter in Visual Basic
Source code and step by step tutorial (pdf format) on how to create a program that converts Celsius to Fahrenheit.
Source code:
Private Sub Command2_Click()
txtc.Text = 0
txtf.Text = 32
End Sub
Private Sub txtc_Change()
If txtc.Text = "" Or IsNumeric(txtc.Text) = False Then
MsgBox "Please enter a numeric value"
txtc.SetFocus
Else
txtf.Text = Format(Val(txtc.Text) * (9 / 5) + 32, "##,##0.00")
End If
End Sub
Private Sub txtf_Change()
If txtf.Text = "" Or IsNumeric(txtf.Text) = False Then
MsgBox "Please enter a numeric value"
txtf.SetFocus
Else
txtc.Text = Format((Val(txtf.Text) - 32) * (5 / 9), "##,##0.00")
End If
End Sub