|
|
#1 |
|
New Member
Join Date: Nov 09
Posts: 5
![]() |
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.
|
|
|
|
|
|
#2 |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,482
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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.
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
#3 |
|
.NUT
Join Date: May 05
Location: Sydney, Australia
Posts: 61,542
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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.
__________________
![]() 2007-2010 Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs MSDN "How Do I?" Videos: VB | C# VBForums Database Development FAQ My CodeBank Submissions: VB (Nullable Data Extensions *NEW*) (Serial Code TextBox *NEW*) | C# (ForumAccount has translated some of my VB submissions to C#) My Blog: Defining and Raising Custom Events | Using Parameters in ADO.NET | Keyboard Events *NEW* |
|
|
|
|
|
#4 |
|
New Member
Join Date: Nov 09
Posts: 5
![]() |
Re: PictureBox Add Action
Thanks. I tried both ways and it worked.
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|