What's the purpose of new 'PreviewKeyDown' event The doc doesn't say much.
Is the only difference that it occurs before the 'KeyDown' event If everyone start using this instead, won't it simply replace 'KeyDown'
When should I use one or the other
What's the purpose of new 'PreviewKeyDown' event The doc doesn't say much.
Is the only difference that it occurs before the 'KeyDown' event If everyone start using this instead, won't it simply replace 'KeyDown'
When should I use one or the other
What's the purpose of 'PreviewKeyDown ' event?
Aaron McKee
I found this excellent answer:
http://blogs.msdn.com/jfoscoding/archive/2006/01/26/518181.aspx
"If you've struggled before with having to override a class in order to set IsInputKey=true so you can get arrow keys for your control, you can now also use the PreviewKeyDown event."
That's apperently what's is for.
Frode Sorhoy
Thanks for the answer, but can't I do exactly the same in 'KeyDown' So I get two equal events fired after one another, right
Or, just a thought, Do 'PreviewKeyDown' get fired before the control internally processes the message and 'KeyDown' after the control's internal processing Is that the difference
blackpanter
LoinHrat
Now I'm really confused. First you say (about PreviewKeyDown):
then about KeyDown:
That looks very much alike to me!
rico81
Use this event for logging logic, shortcut logic because this will be allways fired and can't be stopped by setting a Handled flag.
Jason Poll
PreviewKeyDown
- Fired before KeyDown event.
- Doesn't provide you the functionality to mark it as handled.
KeyDown