Visual Basic 6.0 Simple Calculator

Here i will submit my simple calculator project and sourcecode.
i want discuss about my this simple program. Can you Answer for my doubt about some error handler? when i press after clear a symbol application run out with error . how can i complete the error handler.
run time error = 13

(bellow msgbox using TSC AVERengal font)


Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "/Please provide valid data"
Exit Sub
End If
Label1.Caption = Val(Text1.Text) * (Text2.Text)

End Sub

Private Sub Command1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command2.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Label1.Caption = " "
Text1.SetFocus
End Sub
Private Sub Command3_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "¾¸Å¨Ä ¯ûǣΠ¦ºöÂ×õ !!!"
Exit Sub
End If
Label1.Caption = Val(Text1.Text) + (Text2.Text)
End Sub

Private Sub Command4_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "¾¸Å¨Ä ¯ûǣΠ¦ºöÂ×õ !!!"
Exit Sub
End If
Label1.Caption = Val(Text1.Text) - (Text2.Text)
End Sub

Private Sub Command5_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "¾¸Å¨Ä ¯ûǣΠ¦ºöÂ×õ !!!"
Exit Sub
End If
Label1.Caption = Val(Text1.Text) / (Text2.Text)
End Sub

Private Sub Command6_Click()

answer = MsgBox("¿£í¸û ¦ÅÇ¢§ÂÈ Å¢ÕõÒ¸¢ýÈ£÷¸Ç¡?", vbExclamation + vbYesNo, "Confirm")
If answer = vbYes Then
Unload Me
Else
MsgBox "¿¼ÅÊ쨸 ¿¢Ã¡¸Ã¢ì¸ôÀð¼Ð !", vbInformation, "Confirm"
End If

End Sub

Private Sub Command7_Click()
Text3.SetFocus
Label6.Caption = Val(Text3.Text) * 3 / 100
Label1.Caption = Val(Text3.Text) - Label6.Caption
End Sub

Private Sub Option1_Click()
Form1.BackColor = hx1560032
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

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command7.SetFocus
End If

End Sub

Private Sub Timer1_Timer()
Label5.Caption = Time$
End Sub

Comments

Popular posts from this blog