Code
Public Class Form1
Dim m As Single
Dim v As Single
Dim en As Single
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
txtMassa.Text = 10
txtKecepatan.Text = 40
m = txtMassa.Text
v = txtKecepatan.Text
End Sub
Private Sub txtMassa_TextChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles txtMassa.TextChanged
m = txtMassa.Text
End Sub
Private Sub txtKecepatan_TextChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles txtKecepatan.TextChanged
v = txtKecepatan.Text
End Sub
Private Sub btnHitung_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnHitung.Click
en = (1 / 2) * m * (v ^ 2)
lblEnergiValue.Text = en & " Joule"
End Sub
End Class
Runtime
Click here if you like this article.
0 Comments