本文整理匯總了C#中System.Windows.Forms.DataGridViewRowPrePaintEventArgs.PaintHeader方法的典型用法代碼示例。如果您正苦於以下問題:C# DataGridViewRowPrePaintEventArgs.PaintHeader方法的具體用法?C# DataGridViewRowPrePaintEventArgs.PaintHeader怎麽用?C# DataGridViewRowPrePaintEventArgs.PaintHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.DataGridViewRowPrePaintEventArgs
的用法示例。
在下文中一共展示了DataGridViewRowPrePaintEventArgs.PaintHeader方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: dgvUserDetails_RowPrePaint
void dgvUserDetails_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
e.PaintCells(e.ClipBounds, DataGridViewPaintParts.All);
e.PaintHeader(DataGridViewPaintParts.Background
| DataGridViewPaintParts.Border
| DataGridViewPaintParts.Focus
| DataGridViewPaintParts.SelectionBackground
| DataGridViewPaintParts.ContentForeground);
using (SolidBrush b = new SolidBrush(dataGridView1.RowHeadersDefaultCellStyle.ForeColor))
{
e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, b, e.RowBounds.Location.X + 10, e.RowBounds.Location.Y + 4);
}
e.Handled = true;
}
示例2: UiExifDatGridView_RowPrePaint
private void UiExifDatGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
e.PaintCells(e.ClipBounds, DataGridViewPaintParts.All);
e.PaintHeader(DataGridViewPaintParts.Background
| DataGridViewPaintParts.Border
| DataGridViewPaintParts.Focus
| DataGridViewPaintParts.SelectionBackground
| DataGridViewPaintParts.ContentForeground);
e.Handled = true;
}
示例3: dataGrid_RowPrePaint
void dataGrid_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
e.PaintHeader(DataGridViewPaintParts.Background
| DataGridViewPaintParts.Border
| DataGridViewPaintParts.Focus
| DataGridViewPaintParts.SelectionBackground
| DataGridViewPaintParts.ContentForeground);
e.Handled = false;
}