1. Perkalian 2 bilangan
Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub
Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
End Sub
Private Sub Command3_Click()
End
End Sub
2. Kalkulator mini
Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text4.Text = Val(Text1.Text) * Val(Text2.Text)
Text5.Text = Val(Text1.Text) – Val(Text2.Text)
Text6.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub
Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub
Private Sub Command3_Click()
End
End Sub
3. Perhitungan Harga Setelah Diskon 10%
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.Text = Val(Text1.Text) * 0.1
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End If
End Sub