Solved

Receiving keystrokes as soon as a program is launched?

Posted on 2004-09-06
4
262 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now