473,394 Members | 1,703 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,394 software developers and data experts.

how to trap/detect when entering textbox via tabkey?

Hello,

I need to trap/detect when a textbox is entered via the tabkey. If the
textbox is not empty when entered via the tabkey then set focus to next
textbox. To enter that textbox would then require a mouseclick if it already
contains text to be edited. I am guessing that I would need to trap for
this in the Enter Event of this particular textbox.

I tried this in the Enter Event of the Textbox, but...

if ctype(sender,KeyValuePair(Of, " "))

obviously not working. I would be very grateful if someone could share how
to trap/detect when entering a textbox via the tabkey.

Thanks,
Rich
Jul 7 '06 #1
2 1698
check out the textbox's GotFocus event. that is fired whenever the control
gets the focus, be it by the mouse or tab key, etc
--
-iwdu15
Jul 7 '06 #2
Well, I came up with this

Private Sub txtM_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles txtM.KeyUp
If e.KeyCode.ToString.Equals("Tab") Then
If txtM.Text <"" Then txtlastName.Focus()
End If
End Sub

Interestingly, it was the KeyUp event of the textbox where you can trap for
the tab key. Anyway, this seems to do what I want. Any other suggestions
appreciated.

"Rich" wrote:
Hello,

I need to trap/detect when a textbox is entered via the tabkey. If the
textbox is not empty when entered via the tabkey then set focus to next
textbox. To enter that textbox would then require a mouseclick if it already
contains text to be edited. I am guessing that I would need to trap for
this in the Enter Event of this particular textbox.

I tried this in the Enter Event of the Textbox, but...

if ctype(sender,KeyValuePair(Of, " "))

obviously not working. I would be very grateful if someone could share how
to trap/detect when entering a textbox via the tabkey.

Thanks,
Rich
Jul 7 '06 #3

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

Similar topics

0
by: selowan | last post by:
Hi, In VB6 Pro SP5, I have a form that contains an MSFlexGrid and a few other textboxes and comboboxes. I am using the technique from MSDN article Q241355, which describes how to tab and edit in...
10
by: nkp | last post by:
Sorry guys, basic questions..... 1)how do you prevent negative numeric input in a text box (-2345 etc) 2)how do detect /prevent input of LESS than 8 characters in a text box( where a password must...
2
by: MIG | last post by:
Is there a way that, when using a single or continuous form which allows additions and edits, I can detect when I am entering a new record (eg moved on to *) rather than editing an existing one? ...
5
by: MLH | last post by:
I get error 3315 when attempting to enter ZLS into a text-type table field whose allow zls property is set to false. The error says "Field MyTable.MyField can't be a zero-length string" For...
18
by: Mantorok Redgormor | last post by:
What does a trap representation mean in the standard? And how can ~0 cause a trap representation? Could someone point out the relevant sections in the standard?
3
by: ton | last post by:
How can I detect that the user has modified the data on the page where several textboxes, checkboxes and dropdownlist exist. Ton
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
2
by: ramu | last post by:
Hi, I read the phrase " trap representation" in the topic "Union arrangement" in this group. Can you please tell me what do you mean by it? regards
8
by: =?Utf-8?B?RyBIdXN0aXM=?= | last post by:
This is the 2nd time posting so sorry for duplications. I am using VB.NT 2005 & a standard Combobox. I've been wracking my brain over this problem for a over a month & cannot seem to find a way to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.