By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,422 Members | 1,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,422 IT Pros & Developers. It's quick & easy.

How to Detect the "TAB" Key is Pressed

P: n/a
How to Detect the "TAB" Key is pressed in the Text Box or Combo Box....
Which events catches the TAB key...
I Want to perform some operations when the "TAB" key is pressed...
--
Peter...
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Prabhudhas Peter" <Pr*************@discussions.microsoft.com> schrieb:
How to Detect the "TAB" Key is pressed in the Text Box or Combo Box....
Which events catches the TAB key...
I Want to perform some operations when the "TAB" key is pressed...


Add this to your form's code:

\\\
Protected Overrides Function ProcessTabKey( _
ByVal forward As Boolean _
) As Boolean
MyBase.ProcessTabKey(forward)
MsgBox("Tab key was pressed!")
End Function
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

P: n/a
Hi,

I suggest you use the next code:

Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
If (e.KeyCode = Keys.Tab) Then
MessageBox.Show("Tab Key")
End If
End Sub

With this code, you'll receive the feedback when the user has pushed the Tab
key and the focus has been received by the TextBox Control.

I hope that helps.

Kind regards,

Jorge Serrano PĂ©rez
MVP VB.NET
"Prabhudhas Peter" wrote:
How to Detect the "TAB" Key is pressed in the Text Box or Combo Box....
Which events catches the TAB key...
I Want to perform some operations when the "TAB" key is pressed...
--
Peter...

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.