Question

As far as I know that above is not possible in below case. I explain it in details here.

Suppose If I have Form1 and I set it’s Keypreview Property = true than the

“Keyprees,Keydown,and Keyup" Events are only works for winform not for their child

objects/components Like “textbox”,”ListBox” etc.

So my question is :- Is there possibility to works it for winforms and it’s child controls.?

Is it possible for both forms and controls by setting form1's keypreview property to true?

                               Or By Any Other Way
Was it helpful?

Solution

Even if you set that property to true you will still be able to catch the events for the child controls but you will also be able to catch a 'preview' event on the form and this basically gives you the oprtunity to handle the event before the platform forwards it to the child control.

The MSDN explanation is conclusive.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top