Try this :
VB Code:
Private Sub btnKey2to9Handler(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKey2.Click, btnKey3.Click [b] MsgBox(sender Is Nothing)[/b] If armed = True Or expectingInput = True Then Static KeyValue As String If Not lastKeyPressed Is sender Then AlphaNumericButton.keyPadTimer.Enabled = False End If lastKeyPressed = sender If AlphaNumericButton.IsAlphabetic = False Then KeyValue = sender.Getchr Else 'Working with this part If Not AlphaNumericButton.keyPadTimer.Enabled Then KeyValue = sender.Getchr AlphaNumericButton.keyPadTimer.Enabled = True Else 'Delete the last alpha character. If inputBuffer.Length > 0 Then inputBuffer = inputBuffer.Substring(0, inputBuffer.Length - 1) End If 'Determine the next alpha character. 'Errors here if I click within one second [b] MsgBox(sender Is Nothing)[/b] MsgBox(sender.Getchr) End If End If End If End Sub
If it says false, then the problem might lie in an unhandled exception in the Getchr() method.
I have never used UserControls, but there is the possibility that unhandled exceptions in UserControls are passed up through the call stack - instead of VB catching and showing you the error there.
Try using MsgBox() statements in the Getchr() method to track its progress...




Reply With Quote