29 September 2012

Kalkulator Sederhana


Coding

Dim a As Single, b As Single, c As Single
Private Sub Command1_Click()
Label4.Caption = Text1.Text * Text2.Text
End Sub

Private Sub Command2_Click()
Label4.Caption = Text1.Text / Text2.Text
End Sub

Private Sub Command3_Click()
a = Text1.Text
b = Text2.Text
c = a + b
Label4.Caption = c
End Sub






Private Sub Command4_Click()
Label4.Caption = Text1.Text - Text2.Text
End Sub

Private Sub Command5_Click()
Text1.Text = ""
Text2.Text = ""
Label4.Caption = ""
End Sub

Tidak ada komentar:

Posting Komentar