Use the Textbox's parent paint event to draw the border. You need to set the textbox's region to minus its border for it to show up.
The code will toggle a red border around a text box by pressing a button.
Its hard coded for a 3d border size
Private Sub GroupBox1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles GroupBox1.Paint
'If the textbox's region hasn't been set then this will draw behind
'the textbox.
Dim p As New Pen(Color.Red, 2)
e.Graphics.DrawRectangle(p, New Rectangle(TextBox1.Location + New Size(1, 1), TextBox1.Size - New Size(2, 2)))
p.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Set the region to the textbox's size - its border size.
If TextBox1.Region Is Nothing Then
TextBox1.Region = New Region(New Rectangle(2, 2, TextBox1.Width - 4, TextBox1.Height - 4))
Else
TextBox1.Region = Nothing
End If
End Sub