本文整理汇总了C#中System.Windows.Forms.DataGridViewRowPostPaintEventArgs.DrawFocus方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewRowPostPaintEventArgs.DrawFocus方法的具体用法?C# DataGridViewRowPostPaintEventArgs.DrawFocus怎么用?C# DataGridViewRowPostPaintEventArgs.DrawFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridViewRowPostPaintEventArgs
的用法示例。
在下文中一共展示了DataGridViewRowPostPaintEventArgs.DrawFocus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dgvUsuarios_RowPostPaint
private void dgvUsuarios_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
if (e.RowIndex == this.usuarioBindingSource.Position)
{
e.DrawFocus(e.RowBounds, true);
}
else
{
using (Pen p = new Pen(System.Drawing.Color.LightGray))
{
e.Graphics.DrawRectangle(p, e.RowBounds);
}
}
}
示例2: dataGridView1_RowPostPaint
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
if (e.RowIndex == this.messageBS.Position)
{
e.DrawFocus(e.RowBounds, true);
}
else
{
// Draw background
Pen p;
using (p = new Pen(Color.LightGray))
{
e.Graphics.DrawRectangle(p, e.RowBounds);
}
}
}
示例3: dgvTrainView_RowPostPaint
private void dgvTrainView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
int width = dgvTrainView.Columns.GetColumnsWidth(DataGridViewElementStates.Visible);// +dgvTrainView.Width - 2;
Rectangle rowBounds = new Rectangle(
0, e.RowBounds.Top, width, e.RowBounds.Height - 1);
if (dgvTrainView.CurrentCellAddress.Y == e.RowIndex)
{
//设置选中边框
e.DrawFocus(rowBounds, true);
}
}