473,569 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2618
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****@REMOV Ea-znet.com> wrote in message
news:Ok******** *****@TK2MSFTNG P10.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
GetAsyncKeyStat e is exactly what I need. Of course a managed equivalent
would be better.

Thanks for the interest
Cal
"Jerry" <Je*********@Ya hoo.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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****@REMOV Ea-znet.com> wrote in message
news:Ok******** *****@TK2MSFTNG P10.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
1795
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
16295
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
1232
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 restore back to normal windows, I found ALL the PictureBox's mouse event didn't fire when my mouse enter or leave the PictureBox..
0
1228
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 restore back to normal windows, I found ALL the PictureBox's mouse event didn't fire when my mouse enter or leave the PictureBox..
5
4886
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 the picturebox control's borderstyle to Fixed3D, but upon doing so, I am not able to track the picturebox control through mousemove events (if you...
38
2998
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) Now, when the Picturebox gets resized by the user, I want the image to recalculate and display as "Fit All" again. So I have code in my...
4
5388
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 pictureboxes: ---------------------------------------------------------------------------- Dim MynewPos As New Point(50, 40) Private Sub...
2
6122
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 loading images into the picturebox. If you double click the file you want to open in the open file dialog, it somehow interperets one of the clicks...
1
2484
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 particular product and populates the picture boxes using the paths found by the stored procedure. Anyway, that part works great. I have the Picture Boxes...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.