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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • unknown1995
    New Member
    • Dec 2014
    • 1

    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#
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    you should now where it is....
    after all, you clicked on it!

    Comment

    • Joseph Martell
      Recognized Expert New Member
      • Jan 2010
      • 198

      #3
      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:
      Code:
              private void pictureBox1_Click(object sender, EventArgs e) {
                  Point location = pictureBox1.Location;
              }

      Comment

      Working...