Using PGoRule's code from I have been able to capture the Tab key. Now, I want to be able to find out which textbox control was active when the tab key was pressed. I tried the following code...
But it's not evaluating Me.ActiveControl until AFTER the tab has moved to the next field. So, upon hitting the tab key on Textbox2, the message appears. I want it to appear when I hit the Tab key on Textbox3. Any suggestions?
Code:
Protected Overrides Function ProcessTabKey(ByVal forward As Boolean) As Boolean
MyBase.ProcessTabKey(forward)
If Me.ActiveControl.Name = "Textbox3" Then
MessageBox.Show("GOT IT!!!")
End If
End Function
But it's not evaluating Me.ActiveControl until AFTER the tab has moved to the next field. So, upon hitting the tab key on Textbox2, the message appears. I want it to appear when I hit the Tab key on Textbox3. Any suggestions?