473,398 Members | 2,525 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,398 software developers and data experts.

Preventing a control from losing focus

I am currently working on a project where I am using a bar code scanner that enables people to scan their employee ID and another bar code from a piece of paper. The scanner scans the code to a text box that has focus. However afterwards the text box loses focus and I can't set the focus to the text box in its lostfocus() event.

Any ideas how to do this?

I am working with Microsoft Access 2003.

Any help would be greatly appreciated.

Regards

Me!
Nov 14 '11 #1
3 6048
Post was not needed, found a solution to the problem that i had previously overlooked
Nov 14 '11 #2
For anyone interested I have figured out a solution to this issue.
It's rather simple but i makes my system work :-)

I added an invisible control to the form and made it next in the tab order after my input text box. Under the "On Got Focus" of this control i made it return the focus to my input text box. This way I can still use my other controls while maintaining focus on that text box after someone enters a value into it.

Regards

ME!
Nov 14 '11 #3
NeoPa
32,556 Expert Mod 16PB
I wonder if you considered adding your code to the control that was already next in the sequence rather than having to add a new, invisible, control just for that purpose.

Also, have you considered mouse usage? The mouse can click on any control that can take the focus. If you want to disallow this then each such control needs the same code associated with it.

You may also want to consider the .TabStop property of the other controls.
Nov 14 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Morten Wennevik | last post by:
I'm pretty sure this has been mentioned a few times, but so far I haven't found anything. I am trying to "lock" a program to always focus, non closable etc, but overriding OnDeactivate and...
5
by: Vinny Vin | last post by:
I would like to display a ToolTip (WinForms) when the Control associated recieves focus (when the control.enter event is triggered) as oppose to having the ToolTip displayed when the mouse hovers...
3
by: Tisconi | last post by:
Hi Using C#, is there a way of determining which control has focus on visible form when user presses a key on keyboard. Thanks for any advice Regards
0
by: Stefan De Schepper | last post by:
Dear NG, I created a gridlike usercontrol. When clicking on a cell a textbox (or other control, depending on the cell's editortype) is shown. When some other control gets the focus, the textbox...
3
by: Chris | last post by:
I have a form that calls ShowDialog on a number of different forms at different times. I want to be able to know anytime the form loses focus. But Form.Focused isn't ever true once a control has...
1
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP...
4
by: Jon Slaughter | last post by:
I've created some custom controls and forms that allow the feature to temporarily transfer focus to a control that has been entered by the mouse. Everything seems to work fine but the problem I...
3
by: Fritz Switzer | last post by:
I'm trying to AppendText to a TextEdit. I have a procedure that will go through the controls on a Windows form and return the control that has "focus". I have a number of TextEdits on my form...
5
by: LabGeek | last post by:
I have an Access application that I have created that collects data from a scanner and from a weighting scale. The data from the scanner are unique identifiers (barcodes) and the scanner is...
3
by: StinkyDuck | last post by:
Is there a way to detect when a control gains focus on a webform? Say I have two text boxes. After the user types in information on the first text box and hits the tab key or clicks on the second...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...
0
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...
0
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,...

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.