title: How can i draw a rectangle around the pictureBox1 borders?
body: <p>In the pictureBox1 paint event i tried to draw a rectangle around the Image in the pictureBox1:</p>
  
  <pre><code>private void pictureBox1_Paint(object sender, PaintEventArgs e)
          {           
                  e.Graphics.DrawRectangle(new Pen(Brushes.Red, 5), new Rectangle(0, 0, pictureBox1.Image.Width,
                      pictureBox1.Image.Height));           
          }
  </code></pre>
  
  <p>But what i get is this:</p>
  
  <p><img src="https://i.stack.imgur.com/p2Hb6.jpg" alt="Rectangle around image"></p>
  
  <p>And i also tried to draw a rectangle aorund the pictureBox1 it self:</p>
  
  <pre><code>private void pictureBox1_Paint(object sender, PaintEventArgs e)
          {
              e.Graphics.DrawRectangle(Pens.Green, 0, 0
                                       , pictureBox1.Width, pictureBox1.Height);
          }
  </code></pre>
  
  <p>But in this case i'm getting a thick green line only on the left and the top the right and bottom without green.</p>
  
  <p><img src="https://i.stack.imgur.com/CFNLD.jpg" alt="Rectangle around pictureBox"></p>
  
  <p>The pictureBox1 in the desinger it's property SizeMode is set to StretchImage
  How can i draw the rectangles in both cases ?</p>
  
  <p>And how the property of the top line i called ? It's not Height maybe top ? If i want to find and draw only on the top of the pictureBox how does it called ?</p>