Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to control a key pression when the focus is in any control on the form?

Posted on 1998-10-18
1
Medium Priority
?
190 Views
Last Modified: 2010-04-06
Hi...

I have a form with some stringrid controls, some scrollbars, a status bar and a lot of text edit control. I need the program perform an action when a key is pressed (actually, the key is F7) wherever the focus is. When the application is started, one of the text edit controls has the focus and if I define the key press event for the form, the function isn't executed when I press F7 when a focus is in the control.

How can I do it?
Thanks in advance

Jaime
0
Comment
Question by:skel
1 Comment
 
LVL 4

Accepted Solution

by:
dwwang earned 200 total points
ID: 1343279
You should set form's keypreview property to true, then the form should receive the key press befor any control can receive it.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview

879 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