kalkulator aritmatika

3

Private Sub Combo1_Click()
If Combo1.Text = “perkalian” Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
ElseIf Combo1.Text = “penjumlahan” Then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
ElseIf Combo1.Text = “pembagian” Then
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
ElseIf Combo1.Text = “pengurangan” Then
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
Else
MsgBox “pilih dulu coy operasi perkalian diatas”
End If
End Sub

Private Sub Command1_Click()
Combo1.Text = “”
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text1.SetFocus
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Activate()
Command1_Click
End Sub

Private Sub Form_Load()
Combo1.AddItem “perkalian”
Combo1.AddItem “penjumlahan”
Combo1.AddItem “pembagian”
Combo1.AddItem “pengurangan”
End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s