【发布时间】:2014-03-25 22:58:32
【问题描述】:
我喜欢在 tablelayoutpanel 中绘制多个单元格。我知道如何将行和列绘制为下面的普通代码:
private void tableLayoutPane1_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
{
if (e.Row == 3 || e.Row == 4 || e.Row == 5)
{
LinearGradientBrush brush = new LinearGradientBrush(e.CellBounds, Color.White, Color.Transparent, 90F);
e.Graphics.FillRectangle(brush, e.CellBounds);
}
}
但我想为 3 个单元格或行设置一个矩形渐变,另一方面为 3 个单元格或多个单元格设置一个合并渐变。
【问题讨论】:
标签: c# winforms tablelayoutpanel