最近项目中发现表格中悬浮信息显示不全,后边的内容变成...
通过重写DataGridView的OnCellMouseEnter事件来实现完全显示
protected override void OnCellMouseEnter(DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0 || this.Rows.Count <= 0)
{
}
else
{
this.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = (this.Rows[e.RowIndex].Cells[e.ColumnIndex].Value ?? string.Empty).ToString();
}
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。