keypress event on picturebox

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
does picturebox or flowlayoutpanel has a keypress event where you can do something when a particular key is pressed?
 
As has been discussed in another of your threads, keyboard events are only relevant when a control has focus. If a control can't receive focus then you would need to handle the event of the form and then do whatever is appropriate form there.
 
Then you can obviously find out for yourself with a test that will take about 1 minute to set up. Call Focus and press a key on the keyboard. Either the control will raise a KeyPress event or it won't and that will be your answer.
 
It works fine on the first keypress, but then it lost focus cause the keypress was an arrow key. Is there a way to in cancel the keypress for previewkeydown?
 
Back
Top