Solved

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

Posted on 1998-10-18
1
177 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 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

21 Experts available now in Live!

Get 1:1 Help Now