我的TableLayoutPanel中有3行,我想在它周围绘制边框:
我怎样才能做到这一点?
我尝试了这个,但它没有绘制第一行的外边框:
If (e.Column = 0 And e.Row = 1) Then
e.Graphics.DrawRectangle(New Pen(Color.FromArgb(94, 94, 94)), e.CellBounds)
End If
此代码的输出为:
非常感谢任何帮助!
答案 0 :(得分:0)
I believe the problem is in the e.Row = 1
part. Remember that the first row is index 0.
Try this:
If (e.Column = 0 And e.Row = 0) Then
e.Graphics.DrawRectangle(New Pen(Color.FromArgb(94, 94, 94)), e.CellBounds)
End If