How can i draw the point in the pictureBox1 center + 10 using Random?
<p>I have this simple code each time i click the button its drawing a point in the pictureBox1 at location 100,100</p>

<p>But i want to calculate first ( i need to learn how to do it ) the center of the pictureBox1.</p>

<p>Then i want to use the Random so each time i click the button it will draw a point randomaly from the pictureBox1 center location + 10 </p>

<pre><code>private void button5_MouseClick(object sender, MouseEventArgs e)
        {
            Random rnd = new Random();
            drawPoint(100, 100);
        }

        public void drawPoint(int x, int y)
        {
         Graphics g = Graphics.FromHwnd(pictureBox1.Handle);
         SolidBrush brush = new SolidBrush(Color.LimeGreen);
         Point dPoint = new Point(x, (pictureBox1.Height - y));
         dPoint.X = dPoint.X - 2;
         dPoint.Y = dPoint.Y - 2;
         Rectangle rect = new Rectangle(dPoint, new Size(4, 4));
         g.FillRectangle(brush, rect);
         g.Dispose();
        }
</code></pre>
