473,388 Members | 1,375 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,388 software developers and data experts.

which PictureBox was clicked?

Hi,

I have 64 pictureboxes that all use the same MouseDown
function. How can I detect which picturebox has been
clicked upon? Can I add an extra parameter to the Event
function?

TIA...John.

gridCell[count].MouseDown += new
MouseEventHandler(gridCell_MouseDown);
...
...
...
private void gridCell_MouseDown(object sender,
MouseEventArgs e)
{
this.textBox1.Text = sender.ToString();
}
Nov 15 '05 #1
2 1224
Cast the 'sender' argument to a PictureBox reference. That's the control
that is generating the event.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"John McD" <ju*********@hotmail.com> wrote in message
news:02****************************@phx.gbl...
Hi,

I have 64 pictureboxes that all use the same MouseDown
function. How can I detect which picturebox has been
clicked upon? Can I add an extra parameter to the Event
function?

TIA...John.

gridCell[count].MouseDown += new
MouseEventHandler(gridCell_MouseDown);
..
..
..
private void gridCell_MouseDown(object sender,
MouseEventArgs e)
{
this.textBox1.Text = sender.ToString();
}

Nov 15 '05 #2
Hi John!

"John McD" <ju*********@hotmail.com> schrieb im Newsbeitrag
news:02****************************@phx.gbl...
I have 64 pictureboxes that all use the same MouseDown
function. How can I detect which picturebox has been
clicked upon? Can I add an extra parameter to the Event
function?


Sorry - This isn't possible. Maybe it is ok to calculate, in which
pictureBox the mouse is?

With kind regards,

Konrad
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John McD | last post by:
Hi, I have 64 pictureboxes that all use the same MouseDown function. How can I detect which picturebox has been clicked upon? Can I add an extra parameter to the Event function? ...
2
by: Sean | last post by:
Hello all, I have an application that is using some picture box controls that are being used to preview jpg files. The jpg files are created on the fly and will be overwritten when needed. The...
12
by: yaya via DotNetMonster.com | last post by:
Hi, I have a picture box with circles and rectangles, and I wana save all the images into a jpg file, i tried pictureBox1.Image.Save(@"c:\1.jpg"); but I got and error...
4
by: Keith Smith | last post by:
I am making a program that needs to put a copy of a certain small image wherever the user clicks with the mouse. I am using a pictureBox as my main area (although I can change this if necessary). ...
3
by: EricJ | last post by:
imagine having a fixed picture in a form, if the user clicks in the picture an x has to be displayed where the user clicked (so far not much problems). But the user can make as much x'ses as he...
1
by: cmac89 | last post by:
Dear Group, I wonder if anyone can help me with a little VB.NET picturebox problem? I want to let the user click on a map and where they click I want to draw a circle. I'm using the...
6
by: robusto33 | last post by:
Hi everyone, I'm really new to C#.net development, especially for win32 applications. I'm basically making a board game and was wondering if anyone could help me out with this predicament: I have...
0
by: Mike | last post by:
I am a novice writing a simple program in Visual C++ Express and am having an issue. I basically have several picture boxes of the same size on top of each other with only one visible at a time. ...
4
by: munibe | last post by:
Hi, i have a problem about picturebox control. if you may help me, i will be so happy. i have a picturebox named pic_map, and i added a button named customer_button, my wish is to add a new small...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.