标签:winform datagridview style blog http color io os ar
void From_Load(object sender, EventArgs e) { this.dgvSystemLog.ShowCellToolTips = true; this.dgvSystemLog.CellMouseEnter += new DataGridViewCellEventHandler(dgvSystemLog_CellMouseEnter); } /// <summary> /// 鼠标移到单元格时,设置当前单元格的ToolTipText属性内容为当前单元格内容 /// 解决tip内容显示不全的问题 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void dgvSystemLog_CellMouseEnter(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0 || dgvSystemLog.Rows.Count <= 0) return; dgvSystemLog.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = (dgvSystemLog.Rows[e.RowIndex].Cells[e.ColumnIndex].Value ?? string.Empty).ToString(); }
C# DataGridView在单元格提示里(ToolTip)显示完整的单元格内容
标签:winform datagridview style blog http color io os ar
原文地址:http://www.cnblogs.com/huangtailang/p/3977778.html