By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,567 Members | 1,672 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,567 IT Pros & Developers. It's quick & easy.

Form KeyPress e.Handled question

P: n/a
If a KeyUp event takes place on my form, how can I keep the
KeyDown/KeyPress/KeyUp events from being run on the control event itself.

I tried putting e.Handled=true; at the end of my KeyUp event, but that
doesn't seem to work. Am I missing something? It appears that the KeyUp
event on my control still runs. Help!
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Keith Smith" <ke*********@verizon.net> wrote in message
news:aAnXd.71068$uc.60324@trnddc08...
If a KeyUp event takes place on my form, how can I keep the
KeyDown/KeyPress/KeyUp events from being run on the control event itself.


Override the ProcessKeyPreview method. The message ID is included in the
event args -- look for the messages you want to filter, and return true if
you handle them in the form.

--
Mickey Williams
Author, "Visual C# .NET Core Ref", MS Press
www.neudesic.com
www.servergeek.com
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.