• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

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

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
skel
Asked:
skel
1 Solution
 
dwwangCommented:
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

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now