Hi youki,
Maybe you can try to use ToolTip.SetToolTip() method.
Please refer to the following code:
ToolTip _toolTip;
public Form1()
{
InitializeComponent();
_toolTip = new ToolTip();
_toolTip.AutoPopDelay = 30000;
dataGridView1.ShowCellToolTips = false;
_toolTip.ShowAlways = true;
_toolTip.InitialDelay = 1000;
_toolTip.ReshowDelay = 500;
}
private int cellColumnIndex = -1;
private int cellRowIndex = -1;
private void dataGridView1_CellMouseMove(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.ColumnIndex != cellColumnIndex || e.RowIndex != cellRowIndex)
{
this._toolTip.Hide(this.dataGridView1);
cellColumnIndex = e.ColumnIndex;
cellRowIndex = e.RowIndex;
if (cellColumnIndex >= 0 && cellRowIndex >= 0)
{
this._toolTip.SetToolTip(this.dataGridView1, this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
}
}
}
The result:
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.