|
-
Nov 28th, 2009, 11:28 AM
#1
Thread Starter
New Member
PictureBox Add Action
I have a picture box appear, and I need to make it so if they click a part on the picture box (using x,y position of the box) it does something. Thanks in advance.
-
Nov 28th, 2009, 03:36 PM
#2
Re: PictureBox Add Action
Use the MouseDown event of the picturebox, and then look at the e.location property to determine the x/y coordinate where the mouse was clicked, and take whatever action needs to be taken.
-
Nov 28th, 2009, 06:50 PM
#3
Re: PictureBox Add Action
Not that kleinma is wrong, but you might want to consider using MouseClick rather than MouseDown. MouseDown is raised when and where the mouse button is depressed, whereas MouseClick is raised when and where the mouse button is released, and then only if the mouse button was depressed over the PictureBox too. Neither is right or wrong. It just depends which is more appropriate for your app.
-
Nov 29th, 2009, 05:41 PM
#4
Thread Starter
New Member
Re: PictureBox Add Action
Thanks. I tried both ways and it worked.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|