Solved

Receiving keystrokes as soon as a program is launched?

Posted on 2004-09-06
4
263 Views
Last Modified: 2010-04-15
I have been given the task of optimizing the productivity done by the data entry people. I need to write a few small utilities. The important thing about this task is that the keystrokes needed to accomplish a task must be minimized. When my utility is launched the user needs to be able to start typing data. After the program is launched it has focus, but for some reason I do not receive KeyPress Events in my form. What must I do to fix this?

Thank you for your time,
Arrummzen
0
Comment
Question by:Arrummzen
4 Comments
 
LVL 20

Expert Comment

by:TheAvenger
ID: 11988250
What controls do you have on the form? Which of them has the focus? If a text box has a focus, the form will not receive the KeyPress events, but the TextBox will handle them.
0
 
LVL 18

Expert Comment

by:armoghan
ID: 11988258
0
 
LVL 4

Accepted Solution

by:
somnatic earned 250 total points
ID: 11988410
on your form .. set the property KeyPreview to true ...

you should then receive all keypresses
0
 
LVL 1

Author Comment

by:Arrummzen
ID: 11991343
Thanks. Thats what I needed.

Thank you for your time,
Arrummzen
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question