24 | 05 | 2017

Number Counter

 

Option Explicit

Private Sub cmdMinus_Click()
On Error GoTo Err
If Allowed = False And Val(lblCount.Caption) = 0 Then
    MsgBox "Negative numbers are not allowed.", vbOKOnly + vbExclamation, "Invalid Procedure"
    Exit Sub
ElseIf Allowed = False And (SetMinus > Val(lblCount.Caption)) Then
    MsgBox "Existing count is lesser than the number being subtracted." & vbCrLf & "Negative number deduction is turned off." & vbCrLf & "Current Count: " & Val(lblCount.Caption) & vbTab & "Decrease Value: " & SetMinus, vbOKOnly + vbExclamation, "Invalid Procedure"
    Exit Sub
Else
    Call InitializeCount(Val(lblCount.Caption) - SetMinus, lblCount)
End If

Exit Sub
Err:
    MsgBox Err.Description, vbCritical, "Error"
    Exit Sub
End Sub

Private Sub cmdPlus_Click()
On Error GoTo Err
Call InitializeCount(Val(lblCount.Caption) + SetPlus, lblCount)

Exit Sub
Err:
    MsgBox Err.Description, vbCritical, "Error"
    Exit Sub
End Sub

Private Sub cmdReset_Click()
Call highlights(frmSet.txtSet)
frmSet.txtSet.Text = lblCount.Caption
frmSet.Show vbModal, Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim msg As String
msg = MsgBox("Are you sure you want to exit the application?", vbYesNo + vbInformation, "Exit Application")
If msg = vbNo Then
    Cancel = 1
Else
    End
End If

End Sub

Private Sub mnuFile_Click()

End Sub
Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2258945
Latest Articles