473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

TAB key and Keypress

Hi all,
When I press the tab key, I cannot fire the keyup and the keydown or any
keypress events
How then would I capture those events?

Thanks
Nov 21 '05 #1
4 5373
"spongebob-straight pants" <me@asd.com> schrieb:
When I press the tab key, I cannot fire the keyup and the keydown or any
keypress events


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
"spongebob-straight pants" <me@asd.com> schrieb:
When I press the tab key, I cannot fire the keyup and the keydown or any
keypress events


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 #3
Sponge Bob,
In addition to the other comments.

There are a number of advanced keyboard overrides, unfortunately I don't
have any real good examples of using these, other then they allow you to
intercept the key significantly earlier
then the OnKey* methods, including the Tab key.

I want to say you want to use IsInputChar or IsInputKey to check for a Tab,
if its a Tab returning false will allow the Tab to be handled by your
control. I normally override all the advanced keyboard overrides, watch
(w/Debug.WriteLine) the values coming out to determine which one to actually
use...

*advanced keyboard overrides include: IsInputChar, IsInputKey,
PreProcessMessage, ProcessCmdKey, ProcessDialogChar, ProcessDialogKey,
ProcesKeyEventArgs, ProcessKeyMessage, ProcessKeyPreview, and
ProcessMnemonic.

If I find an example I will post one later...

Hope this helps
Jay

"spongebob-straight pants" <me@asd.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi all,
When I press the tab key, I cannot fire the keyup and the keydown or any
keypress events
How then would I capture those events?

Thanks

Nov 21 '05 #4
Sponge Bob,
In addition to the other comments.

There are a number of advanced keyboard overrides, unfortunately I don't
have any real good examples of using these, other then they allow you to
intercept the key significantly earlier
then the OnKey* methods, including the Tab key.

I want to say you want to use IsInputChar or IsInputKey to check for a Tab,
if its a Tab returning false will allow the Tab to be handled by your
control. I normally override all the advanced keyboard overrides, watch
(w/Debug.WriteLine) the values coming out to determine which one to actually
use...

*advanced keyboard overrides include: IsInputChar, IsInputKey,
PreProcessMessage, ProcessCmdKey, ProcessDialogChar, ProcessDialogKey,
ProcesKeyEventArgs, ProcessKeyMessage, ProcessKeyPreview, and
ProcessMnemonic.

If I find an example I will post one later...

Hope this helps
Jay

"spongebob-straight pants" <me@asd.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi all,
When I press the tab key, I cannot fire the keyup and the keydown or any
keypress events
How then would I capture those events?

Thanks

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Alex007 | last post by:
Hi, I've been working on this C assignement for a CS course.... the assignement is going pretty well and all my code works well on both Windows and Linux. The only thing that doesn't work is...
3
by: Darryn Ross | last post by:
Hi, I am trying to catch the KeyPress event on my datagrid but it isn't working... i have also tried registering the handler with the event like this... dgGLBatch.KeyPress += new...
2
by: rege | last post by:
Hi, I have two applications developed in C# say A and B. When user presses key "L" with applicaition A active , it causes a keypress event which causes application B to run. Application A then...
1
by: Rene | last post by:
Hi, I am running is some problems with the KeyPreview and KeyPress events. The KeyPress event is only triggered when there this an focusable control on the form. When all controls are disabled...
4
by: Tom | last post by:
I have a VB.NET user control that I wrote - this control has three or four other controls on it (textbox, combobox, datetime picker, etc). Now, whenever the control is on a form and the user enters...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
3
by: Fia | last post by:
Hi In Visual Basic 6 I could call keypress with an integer of a choosen key. For example I could call a textbox's keypress with the number 13 (for the enter key). But now in Visual Basic .Net I...
5
by: Henry Jones | last post by:
I am new to C# and wanted to capture the KeyPress for a textbox. I created some code as follows: private void textBox3_KeyPress(object sender, System.EventArgs e) { this.textBox2.Text =...
2
by: Tony Johansson | last post by:
Hello! I have created a Control that consist of a label and a textbox.I have called this class ctlLabelTextbox. public partial class ctlLabelTextbox : UserControl { .... } The class that I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.