读书人

怎么设置DataGridView的行标题

发布时间: 2011-12-12 22:59:56 作者: rapoo

如何设置DataGridView的行标题
我想问一下如何设置DataGridView行标题,可以把他设成CheckBox或文本,图片等信息

[解决办法]
private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex == -1 && e.RowIndex!=-1)
{
e.Handled = true;
e.PaintBackground(e.CellBounds, false);
ControlPaint.DrawCheckBox(e.Graphics, e.CellBounds, ButtonState.Checked);
}
}

读书人网 >C#

热点推荐