Results 1 to 2 of 2

Thread: Get (x,y) in PictureBox

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Get (x,y) in PictureBox

    Hi
    How can I get the (x,y) coordinates of the mouse cursor when I click within a PictureBox???
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Get (x,y) in PictureBox

    Try using the MouseDown Event

    Code:
      
      this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
      
      ...
      
      private void pictureBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
      {
      	MessageBox.Show(e.X.ToString() + " " + e.Y.ToString());
      }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width