from konversi farenhait ke celsius |
Dim fah, cel, kf, kc As Single
Sub kosongkan()
Txtfahrenhait.Text = 0
Txtfahrenhait.Focus()
Txtcelcius.Text = 0
Lblkonversicelcius.Text = 0
Lblkonversifahrenhait.Text = 0
Lblcaracelcius.Text = "?"
Lblcarafahrenhait.Text = "?"
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtfahrenhait.TextChanged
End Sub
Private Sub Btnhitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhitung.Click
fah = Val(Txtfahrenhait.Text)
cel = Val(Txtcelcius.Text)
kf = 5 / 9 * (fah - 32)
kc = 9 / 5 * cel + 32
Lblcaracelcius.Text = " 9 / 5 * " & cel & " + 32 = "
Lblcarafahrenhait.Text = " 5 / 9 * ( " & fah & " - 32 ) "
Lblkonversicelcius.Text = kc
Lblkonversifahrenhait.Text = kf
End Sub
Private Sub Btnkosong_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkosong.Click
kosongkan()
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
Close()
End Sub
End Class
0 komentar:
Posting Komentar