473,796 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,Ke yValuePair(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 1725
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(ByVa l sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txtM.KeyUp
If e.KeyCode.ToStr ing.Equals("Tab ") Then
If txtM.Text <"" Then txtlastName.Foc us()
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,Ke yValuePair(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
3472
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 a flexgrid. Briefly, the technique is to overlay the cell to be edited with "floating" textbox; data is edited in the floating textbox and moved to the cell when the floating textbox loses focus. The technique works well except for when the...
10
4420
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 be a minimum of 8 characters for example) Thank you.
2
3915
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? In general, while wanting edits to be allowed, I want to be able to warn if certain fields are being edited unexpectedly, but not do this while a new record is being entered. It's to avoid the sort of situation where someone thinks they are...
5
2993
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 sure, this is what I expected, entering into a table. The same 3315 error occurs if you try to enter "" into a bound textbox control on a form (bound to the same field. I expected that too.
18
9092
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
4503
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
3951
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 textboxes and a checkbox. The behaviour I want from my app is as follows:- When the textbox (which is prior in tab order to the tab control) has been filled with a certain length of text by the user, the focus is
2
339
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
13412
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 trap the pressing of a Tab Key when the focus is in a Combobox. The KeyDown or KeyUp event for a combobox will not fire when the tab key is pressed. The Keyup event will fire when the Tab key is used to tab into the combo, however I want to trap...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10221
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.