tugas 2

cara membuat kalkulator sederhana

Capture

TUGAS 2
Private Sub Command1_Click()
texthasil.Text = Val(Textnilai1.Text) + Val(Textnilai2.Text)
End Sub

Private Sub Command2_Click()
texthasil.Text = Val(Textnilai1.Text) * Val(Textnilai2.Text)
End Sub

Private Sub Command3_Click()
texthasil.Text = Val(Textnilai1.Text) / Val(Textnilai2.Text)

End Sub

Private Sub Command4_Click()
texthasil.Text = Val(Textnilai1.Text) – Val(Textnilai2.Text)

End Sub

Private Sub Command5_Click()
Textnilai1.SetFocus
Textnilai1.Text = “”
Textnilai2.Text = “”
texthasil.Text = “”
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

Private Sub Textnilai1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textnilai2.SetFocus
End If
End Sub

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s