473,399 Members | 4,177 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,399 software developers and data experts.

location of picturebox: How to get location of a picturebox by clicking on it in c#

How to get location of a picturebox by clicking on it in c#
Dec 30 '14 #1
2 2931
Luuk
1,047 Expert 1GB
you should now where it is....
after all, you clicked on it!
Dec 30 '14 #2
Joseph Martell
198 Expert 128KB
Luuk's answer gets you the location of a point on the screen. If you want the location on your form then you can just use the PictureBox's Location property:
Expand|Select|Wrap|Line Numbers
  1.         private void pictureBox1_Click(object sender, EventArgs e) {
  2.             Point location = pictureBox1.Location;
  3.         }
  4.  
  5.  
Jan 17 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Paul L | last post by:
I've created a picturebox inside a panel control with autoscroll enabled. The picturebox is twice the size of the panel so scrollbars are always shown. What I would like to do, is when the user...
0
by: Lespaul36 | last post by:
I need to get the location of a picturebox inside a picturebox. I think I need to use pointtoclient to get the right point, but I keep getting negative numbers. Dim pnt As New Point(e.X, e.Y)...
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...
4
by: Ikey | last post by:
I am trying to allow a user to drag a Picturebox control around the form and drop it in a new location. Currently, I was trying to use the following: Private Sub PictureBox1_MouseMove(ByVal...
0
by: Frustrated | last post by:
I have a third party DLL that communicates with a camera (Sony 1384) and I have it working where the image is being displayed in a picturebox. I am using VB.NET . There is a function in the...
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...
3
by: sin | last post by:
Hello, I have small problem, here's the situation: There are a windows form - Form1; And two picturebox'es - pictureBox1 and pictureBox2; Those two pictures are transparent in some areas; I...
3
by: Jeff Ciaccio | last post by:
I am programming a "craps table", and I would like to randomize where the dice land. The first one is no problem. To fit on the "table" I have the following: picDie1.Location = New Point(Rnd() *...
5
by: AWW | last post by:
XP VB 2005 running an example from help that creates a picturebox in code - the picturebox is not created. If I comment out the "Dim Box as New PictureBox" and create it in Design mode - the...
2
by: randichan | last post by:
I have a code from some article. (picture inner inside the picture outer) The result of the code is when i was klik the place in the picture outer, the picture inner will show in the place i was...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.