469,923 Members | 1,544 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

C#, PictureBox, and Keypress?

IS there a way to access a keydown event from the .net picturebox
control. I need to display a picture and have the user press the page
up/down key to go to the previous/next pic. I see mouse events but not
keypress. If the PB does not have this, then is there a way to
intercept a kepress from any control on the form?

Thanks
Nov 15 '05 #1
1 7654
David,

You could derive a class from PictureBox and then intercept the
appropriate windows messages. You can intercept the WM_KEYDOWN message to
find out when a key is pressed when the PictureBox has focus. Then, just do
what you have to do when the appropriate key is pressed.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"David M" <ma*****@purgethis-aegiscomgroup.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
IS there a way to access a keydown event from the .net picturebox
control. I need to display a picture and have the user press the page
up/down key to go to the previous/next pic. I see mouse events but not
keypress. If the PB does not have this, then is there a way to
intercept a kepress from any control on the form?

Thanks

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by akh | last post: by
3 posts views Thread by Fia | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.