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

Registering a Keystroke from Anywhere on a Form

Hi all,

I have a form with a number of textboxes on it. What I would like to happen is when a user presses F3 while anything on the form, including the form itself, has focus. I want it to clear all the textboxes. I can make this happen for each textbox individually but I wondered if there was a way to make this happen globally on the form.

Many Thanks
0
kiranboi
Asked:
kiranboi
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
Hi kiranboi,

Set the form's KeyPreview property to True and handle the form's KeyDown event.

Cheers!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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