I’m using PictureBox to place and relocate (move) some picture inside Main Dialog Form.
I want to be able to remove the picture on Delete Key pressed.
I can’t find the keyboard handling events for the listed controls.
Well, I can use KeyDown for the Form and check if the PictureBox is focused, but it looks ugly.
Can see like it has the event http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.keydown.aspx
But in fact doesn’t…
Any idea?
It is a not-so-subtle hint that neither of those controls can get the focus. Keyboard events are only ever generated for controls that can be focused. TextBox being the ultimate example, but many others do. They have a way to indicate the focus to the user, typically with the dotted focus rectangle, a color or a caret.
But not PictureBox nor Label, you can click on them all you want but they won’t take the focus and won’t indicate it. They are just little peons that respectively show an image or text. The user doesn’t expect them to do anything interesting.
I can’t tell what kind of focus behavior you want to give them, but an example of turning a non-focusable control into a focusable one is in this answer.