By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,678 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,678 IT Pros & Developers. It's quick & easy.

Can I get a KeyPressed event in PictureBox

P: n/a
I have a picturebox usercontrol sitting on a usercontrol. I need a KeyPress
event in the PictureBox.

I suppose I could have a property in the pictureBox that is accessed by a
call in a KeyPressed event in the UserControl. Right?

Kind of kludge - is there a more direct way? The usercontrol needs no
KeyPress event at all and the Picturebox needs them all.
Cal
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Is this KeyPress event to fire only when the picturebox control has the
focus?
What would cause the user to give the picture box the focus on the form?
Are you trying to create a zoned bitmap?

" active" <ac****@REMOVEa-znet.com> wrote in message
news:Ok*************@TK2MSFTNGP10.phx.gbl...
I have a picturebox usercontrol sitting on a usercontrol. I need a KeyPress event in the PictureBox.

I suppose I could have a property in the pictureBox that is accessed by a
call in a KeyPressed event in the UserControl. Right?

Kind of kludge - is there a more direct way? The usercontrol needs no
KeyPress event at all and the Picturebox needs them all.
Cal

Nov 20 '05 #2

P: n/a
After I thought about it a while I realized I didn't ask the correct
question so I posted again and got a good response. Turns out a call to
GetAsyncKeyState is exactly what I need. Of course a managed equivalent
would be better.

Thanks for the interest
Cal
"Jerry" <Je*********@Yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Is this KeyPress event to fire only when the picturebox control has the
focus?
What would cause the user to give the picture box the focus on the form?
Are you trying to create a zoned bitmap?

" active" <ac****@REMOVEa-znet.com> wrote in message
news:Ok*************@TK2MSFTNGP10.phx.gbl...
I have a picturebox usercontrol sitting on a usercontrol. I need a

KeyPress
event in the PictureBox.

I suppose I could have a property in the pictureBox that is accessed by a call in a KeyPressed event in the UserControl. Right?

Kind of kludge - is there a more direct way? The usercontrol needs no
KeyPress event at all and the Picturebox needs them all.
Cal


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.