title: Label text with border
body: <p>I have a label with text "UserName" in foreground color as white and the form is on a sky-blue color. I would like to add a black border NOT to the label itself, but to the text inside of it.</p>
  
  <p>Is this possible?</p>
  
  <pre><code> Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          btnLogin.Enabled = False
          centrarVentana(Me)
          lblNombreUsuario.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
  End Sub
  </code></pre>
  
  <p>The code obviously is just for show,since it does not do what I want.</p>
  
  <p>Edit FINAL : Thanks so much everybody. It finally worked! I am leaving the code here so everybody can re use. Once you understand it its actually really easy.</p>
  
  <pre><code>Imports System.Drawing.Drawing2D
  
  Public Class BorderLabel
      Inherits Label
      Public outline_color As Color = Color.Black
      Public border_thickness As Integer = 5
      Public Sub New()
          MyBase.New
  
      End Sub
  
  
      Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
          e.Graphics.FillRectangle(New SolidBrush(BackColor), ClientRectangle)
          Dim gp As GraphicsPath = New GraphicsPath
          Dim outline As Pen = New Pen(Me.outline_color, Me.border_thickness)
          Dim sf As StringFormat = New StringFormat
          Dim foreBrush As Brush = New SolidBrush(ForeColor)
          gp.AddString(Text, Font.FontFamily, CType(Font.Style, Integer), Font.Size, ClientRectangle, sf)
          e.Graphics.ScaleTransform(1.3!, 1.35!)
          e.Graphics.SmoothingMode = SmoothingMode.HighQuality
          e.Graphics.DrawPath(outline, gp)
          e.Graphics.FillPath(foreBrush, gp)
      End Sub
  End Class
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/gWear.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gWear.png" alt="enter image description here"></a></p>
  
  <p>NOTE : This question is not an exact duplicate of <a href="https://stackoverflow.com/questions/19842722/setting-a-font-with-outline-color-in-c-sharp">Setting a Font with outline Color in C#</a> since I am on Visual Basic and had to do code changes for this to work correctly.</p>