Private Sub Command1_Click()
Text3.Text = Val(Text1) + Val(Text2)
End Sub
Private Sub Command2_Click()
Text3.Text = Val(Text1) – Val(Text2)
End Sub
Private Sub Command3_Click()
Text3.Text = Val(Text1) * Val(Text2)
End Sub
Private Sub Command4_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text1.SetFocus
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Command6_Click()
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command7.Enabled = True
Command6.Enabled = False
End Sub
Private Sub Command7_Click()
Text3.Text = Val(Text1) / Val(Text2)
hasil = Val(Text3.Text)
Text3.Text = Format(hasil, “#,#.00”)
End Sub
Private Sub Form_Load()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command7.Enabled = False
Command6.Enabled = True
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub