答案 0 :(得分:1)
作为一个选项,您可以设置边框样式yo none:
Me.DataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.None
然后处理CellPainting
事件并绘制边框:
Private Sub DataGridView1_CellPainting(sender As Object, _
e As DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
If (e.ColumnIndex < 0 OrElse e.RowIndex < 0) Then Return
e.Paint(e.CellBounds, DataGridViewPaintParts.All)
Dim r = e.CellBounds
e.Graphics.DrawLine(Pens.Black, r.Left, r.Top, r.Right, r.Top)
e.Graphics.DrawLine(Pens.Black, r.Left, r.Bottom, r.Right, r.Bottom)
e.Handled = True
End Sub