Solved

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

Posted on 1998-10-18
1
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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