public override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, Brush backgroundBrush, Brush foreBrush)
{
g.DrawLine(new Pen(Brushes.Black), new Point(), new Point());
//g.FillRectangle(Brushes.Black, bounds);
string[] values = CellValue as string[];
if (values == null || values.Length != 4)
throw new ArgumentNullException();
int width = bounds.Width / 4;
for (int i = 0; i < values.Length; i++)
{
Rectangle rec = new Rectangle(bounds.Left + 2 + i * width, bounds.Top + 2, width - 2, bounds.Height - 4);
//设置单元格的背景色
g.FillRectangle(backgroundBrush, rec);
g.DrawString(values[i], TableView.Font, foreBrush, rec.Left + (rec.Width - TableView.Font.Size) / 2, rec.Top);
}
}
我只想要横线,不要列