Draw rectangle around Textbox inside a Groupbox
问题 I want to add a custom border around a TextBox control which is in a GroupBox . Since I'm new to this Graphic stuff I'm having a hard time figuring out the problem. This is the code i'm using: Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint Dim _g As Graphics = Me.GroupBox1.CreateGraphics Dim pen As New Pen(Color.Red, 2.0) _g.DrawRectangle(pen, New Rectangle(TextBox1.Location, TextBox1.Size)) pen.Dispose() End Sub This form is a secondary form that shows when I