title: Replace/Redraw a TextBox 3D border using a custom color
body: <blockquote>
    <p>SCENARIO</p>
  </blockquote>
  
  <p>In <strong>WinForms</strong>, I've sub-classed a <strong>Textbox</strong> to draw my own border with a solid color when <code>BorderStyle</code> property is set to <code>Flat</code>, <code>None</code>, or <code>Fixed3D</code>.</p>
  
  <blockquote>
    <p>PROBLEM</p>
  </blockquote>
  
  <p>When I try to draw a border with a color when my <strong>TextBox</strong> property is set <code>Fixed3D</code>, the border is not properly drawn on the surface:</p>
  
  <p><img src="https://i.stack.imgur.com/zUwIk.png" alt="enter image description here"></p>
  
  <p>What you see in the image is a zoomed TextBox with:</p>
  
  <p>BackColor = Black</p>
  
  <p>BorderStyle = Fixed3D (the white thing)</p>
  
  <p>And the red thing is my intent of border.</p>
  
  <blockquote>
    <p>QUESTION</p>
  </blockquote>
  
  <p>In C# or VB.Net, how I can replace/redraw the 3D border to do what I want?, I mean replace/hide/redraw the white border of the image above.</p>
  
  <blockquote>
    <p>CODE</p>
  </blockquote>
  
  <p>This is what I've tried on the <code>OnPaint</code> method:</p>
  
  <pre><code>    Using g As Graphics = Graphics.FromHwnd(Me.Handle)
  
          ' Dim rect As Rectangle = New Rectangle(0, 0, Me.Width, Me.Height)
  
          ' Dim pen As New Pen(Color.Black, 2)
          ' pen.Alignment = PenAlignment.Inset
          ' g.DrawRectangle(pen, rect)
  
          ControlPaint.DrawBorder(Graphics.FromHwnd(Me.Handle),
                                  Me.ClientRectangle,
                                  Me.borderColor1,
                                  ButtonBorderStyle.Solid)
  
      End Using
  </code></pre>
  
  <p>Also I've tried to use the <code>DrawBorder3D</code> method but any of its overloads accept a color?</p>