title: Getting mouse click position in pictureBox C#
body: <p>I'm trying to get the mouse click coordinates on a picture box and putting the information in a textbox. </p>
  
  <p>I'm able to get the mouse click coordinates in the form but I'm unable to get the mouse coordinates in the picturebox (nothing happens when I click in picturebox).  I've looked at the answers from similar question on stackoverflow but nothing seems to be working for me. </p>
  
  <p>Here is my complete code:  </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  
  namespace testGraphiqueCSharp
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          protected override void OnMouseClick(MouseEventArgs e)
          {
              base.OnMouseClick(e);
              textBox1.Text = e.X.ToString();
              textBox2.Text = e.Y.ToString();
          }
  
         private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
          {
              textBox1.Text = e.X.ToString();
              textBox2.Text = e.Y.ToString();
              Console.WriteLine("mouse up");
          }
      }
  }
  </code></pre>