I am using a KeyUp event looking for a tab key entry. Once the tab key is detected I need to validate the input.
The purpose for this is that the KeyUp event needs to Enable and make Visible buttons on the form if the validation is successful. I have errorproviders on each textbox. I can pass the form and the errorprovider to the validation class method. However, I cannot find how to pass the correct CancelEventArg to the method so I can set it's value to true or false for the textbox that is being validated. This needs to be able to cancel the event to move to another field and I will follow-up with clearing of the error so the errorprovider loses the icon.
Trying to replicate this:
private void txtTempEmpID_Validating(Object sender, CancelEventArgs e)
The Validating Event for a textbox has this as a received parameter. However, I can't use this event as it does not recognize my request to make visible or enabled buttons as it is trapped in the validating because there are no other enabled/visible controls that can take focus. Hence, the event can't fire.
Long story short: Present a textbox awaiting a scan of an employee's badge. Once the scan is made (String collected, tab key entry. all one event) I need to make the appropriate Buttons appear on the form for that employee.