Flaming Arrow Glitter Purple

Rabu, 04 September 2013

Visual Basic ( Calculator Sederhana )

 

Sebuah simulator visual perangkat kalkulator adalah menu visual basic yang begitu menawan hati bagi para programmer,walaupun terkesan sederhana project ini mampu di kembangkan dengan daya imajinasi sendiri oleh penciptanya untuk menambah beberapa bentuk perhitungan yang rumit..
Semangat3x..

CODE

Private Sub cmdAdd_Click()
lblAnswer.Caption = Val(txtFn.Text) + Val(txtSn.Text)
End Sub

Private Sub cmdClear_Click()
txtFn.Text = ""
txtSn.Text = ""
lblAnswer = "0.00"
End Sub

Private Sub cmdCon_Click()
lblAnswer.Caption = txtFn.Text + txtSn.Text
End Sub

Private Sub cmdDiv_Click()
lblAnswer.Caption = Val(txtFn.Text) / Val(txtSn.Text)
End Sub

Private Sub cmdExit_Click()
If MsgBox("Are you sure you want to close My Calculator?", vbQuestion + vbYesNo, "Close Applet") = vbYes Then
    End
Else
    txtFn.SetFocus
End If
End Sub

Private Sub cmdExp_Click()
lblAnswer.Caption = Val(txtFn.Text) ^ Val(txtSn.Text)
End Sub

Private Sub cmdInt_Click()
lblAnswer.Caption = Val(txtFn.Text) \ Val(txtSn.Text)
End Sub

Private Sub cmdMod_Click()
lblAnswer.Caption = Val(txtFn.Text) Mod Val(txtSn.Text)
End Sub

Private Sub cmdMul_Click()
lblAnswer.Caption = Val(txtFn.Text) * Val(txtSn.Text)
End Sub

Private Sub cmdSub_Click()
lblAnswer.Caption = Val(txtFn.Text) - Val(txtSn.Text)
End Sub

Private Sub textempty()
If txtFn.Text = "" And txtSn.Text = "" Then
    MsgBox "Empty Fields!", , "Text Empty"
    txtFn.SetFocus
    lblAnswer.Caption = "0.00"
End If
End Sub

Private Sub textnotnum()
If IsNumeric(txtFn.Text) = False Then
    MsgBox "Enter Number Only!", vbInformation, "Validation"
    txtFn.SetFocus
End If
End Sub
 

Ganti teks ini dengan informasi mengenai permalink atau apapun di sini.


Tidak ada komentar:

Posting Komentar

facebook komentar