title: VB.net Drawing rectangle in the center of the form
body: <p>Good morning community</p>
  
  <p>I want to draw a rectangle exactly in the center of the form. Also, I want draw under this rectangle some text.</p>
  
  <p>With the text I think that I don't have a problem, I use the following code:</p>
  
  <pre><code>Dim sf As New StringFormat
          sf.LineAlignment = StringAlignment.Center
          sf.Alignment = StringAlignment.Center
  
          ' Line with the problem
          e.Graphics.FillRectangle(Brushes.Beige, CInt(Local_Form.Width / 2), CInt(Local_Form.Height / 2), 200, 100)
  
          e.Graphics.DrawString(Local_Text, _
                                New Font(MyCloud.Settings.Settings_Forms.Font.Name, 30), _
                                Brushes.GreenYellow, _
                                Local_Form.Width / 2, Local_Form.Height / 2, sf)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Z1XDK.png" alt="enter image description here"></p>
  
  <p>But, I have problems with the rectangle. Somebody can help me?</p>