http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=78401
这个不能设置面版的边框吗?, 下面的全局代码帖上去会提示错误“未定义的类型Windows.Forms.PaintEventArgs”,怎么用?
全局代码
Public Sub groupBox1_Paint(sender As Object, e As Windows.Forms.PaintEventArgs)
e.Graphics.Clear(Sender.BackColor)
e.Graphics.DrawString(Sender.Text, Sender.Font, Brushes.Red, 10, 1)
e.Graphics.DrawLine(Pens.Red, 1, 7, 8, 7)
e.Graphics.DrawLine(Pens.Red, e.Graphics.MeasureString(Sender.Text, Sender.Font).Width + 8, 7, Sender.Width - 2, 7)
e.Graphics.DrawLine(Pens.Red, 1, 7, 1, Sender.Height - 2)
e.Graphics.DrawLine(Pens.Red, 1, Sender.Height - 2, Sender.Width - 2, Sender.Height - 2)
e.Graphics.DrawLine(Pens.Red, Sender.Width - 2, 7, Sender.Width - 2, Sender.Height - 2)
End Sub
afterLoad事件
Dim gbx As Windows.forms.Groupbox= e.Form.Controls("GroupBox1").basecontrol
addhandler gbx.paint, addressof GroupBox1_paint