我想TextBox
在GroupBox
. 由于我是这个图形的新手,我很难找出问题所在。
这是我正在使用的代码:
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
此表单是辅助表单,当我单击主表单中的按钮时会显示该表单。当表单加载然后消失时,红色边框会出现一秒钟。