473,324 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Can I get a KeyPressed event in PictureBox

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
2 2601
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jose Michael Meo R. Barrido | last post by:
Hi! Can u please tech me a way to know if the image in the picturebox has changed? what event should i catch the chage?
2
by: JJ | last post by:
Hi All, I need to create a MouseDown event for a picture box . Am I doing the following right? pictureBox.MouseDown += new System.WinForms.MouseEventHandler(pictureBox_MouseDown) Then
0
by: Bsiang Tan | last post by:
Hi all, I have a few PictureBox in my windows form... The PictureBox mouse event likle MouseLeave work fine.. But the problem occured when I minimize my form into System Tray, and then...
0
by: Bsiang Tan | last post by:
Hi all, I have a few PictureBox in my windows form... The PictureBox mouse event likle MouseLeave work fine.. But the problem occured when I minimize my form into System Tray, and then...
5
by: BrianW | last post by:
I am working on a program that has multiple picturebox controls that a user is allowed to move around which are contained within a panel control for visual placement. In my mousedown event, I set...
38
by: johnb41 | last post by:
I have a Picturebox that has an image displayed inside. Through code, I was able to have the "whole image" display in it without distortion. (Like a "Fit All" in most any image viewer program) ...
4
by: Rich | last post by:
Hello, I create multiple pictureboxe controls on a form in a For Loop and display thumbnail pictures. I need to add a Click event to these pictureboxes. Here is the routine that creates the...
2
by: Mattbooty | last post by:
Hello, Not sure if anyone else has seen this bug, but I have a form where the entire form is covered with a picturebox. The picturebox has a mouseup event. I also have an open file dialog for...
1
by: euroluxantiques | last post by:
Hi All, Using VB.Net with SQL Server. I have a form that I create a number of Picture Boxes on dynamically, based on a stored procedure that retrieves a listing of images available for a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.