【发布时间】:2017-03-22 03:47:27
【问题描述】:
我正在尝试根据单元格的背景颜色更改单元格边框颜色
这是我用过的
'Draw custom cell borders.
Using Brush As New SolidBrush(grdList.ColumnHeadersDefaultCellStyle.BackColor)
e.Graphics.FillRectangle(Brush, e.CellBounds)
End Using
e.Paint(e.CellBounds, DataGridViewPaintParts.All And Not DataGridViewPaintParts.ContentBackground)
Debug.Print(e.CellStyle.BackColor.ToString)
ControlPaint.DrawBorder(e.Graphics, e.CellBounds, e.CellStyle.BackColor, 1, _
ButtonBorderStyle.Solid, e.CellStyle.BackColor, 1, _
ButtonBorderStyle.Solid, e.CellStyle.BackColor, 1, _
ButtonBorderStyle.Solid, Color.Black, 1, _
ButtonBorderStyle.Solid)
这是结果
我不知道当前看到的白线是什么
【问题讨论】:
-
你不想要白色,但你想要什么?看起来您正在尝试绘制黑线。
标签: .net vb.net winforms datagridview