2
hi in winforms如何在TableLayoutPanel中绘制(fillRectangle)单个单元格? 请勿使用其他面板。winforms如何在TableLayoutPanel中绘制(fillRectangle)单个单元格?
hi in winforms如何在TableLayoutPanel中绘制(fillRectangle)单个单元格? 请勿使用其他面板。winforms如何在TableLayoutPanel中绘制(fillRectangle)单个单元格?
您必须订阅CellPaint事件。 作为一个例子:
private void tableLayoutPanel_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
{
if (e.Row == 0 && e.Column == 1)
{
e.Graphics.FillRectangle(new SolidBrush(Color.Black), e.CellBounds);
}
}
变化'e.ClipRectangle'到'e.CellBounds',这将是正确的答案;)(ClipRectangle指整个面板) – digEmAll 2011-05-17 13:19:04
@digEmAll,谢谢你的建议。发布编辑。 +1 – 2011-05-17 13:35:04
谢谢,很棒的工作!!!!!!!!! – gooteis 2011-05-17 14:24:51