1. Desain Layout
2. Propertise
toolbox name
TextBox txtbil1
TextBox txtbil2
TextBox txthasil
Commad Button cmdtambah
Commad Button cmdkurang
Commad Button cmdkali
Commad Button cmdbagi
Commad Button cmdpangkat
Commad Button cmdreset
3. Script
Private Sub cmdbagi_Click(Index As Integer)
A = Val(txtbil1)
B = Val(txtbil2)
C = A / B
txthasil = C
End Sub
Private Sub cmdkali_Click(Index As Integer)
A = Val(txtbil1)
B = Val(txtbil2)
C = A * B
txthasil = C
End Sub
Private Sub cmdkurang_Click(Index As Integer)
A = Val(txtbil1)
B = Val(txtbil2)
C = A - B
txthasil = C
End Sub
Private Sub cmdpangkat_Click(Index As Integer)
A = Val(txtbil1)
B = Val(txtbil2)
C = A ^ B
txthasil = C
End Sub
Private Sub cmdreset_Click()
txtbil1.Text = ""
txtbil2.Text = ""
txthasil.Text = ""
End Sub
Private Sub cmdtambah_Click(Index As Integer)
A = Val(txtbil1)
B = Val(txtbil2)
C = A + B
txthasil = C
End Sub
Komentar
Posting Komentar