.net 如何为DataGridView单元格中的工具提示设置AutoOpDelay?

.net 如何为DataGridView单元格中的工具提示设置AutoOpDelay?,.net,vb.net,.net,Vb.net,我有一个dataGridView,我通过编程创建了一个dataGridView,我希望通过在每行的第一列/单元格中设置toolTipText来为每行设置不同的toolTipText。我知道我可以通过以下方式做到这一点: myDataGridView.Rows(n).Cells(0).ToolTipText = varContainingText 这个很好用。但是,它仅显示默认时间段(我相信是5秒)。我想设置AutoOpDelay,但似乎不知道如何设置。我似乎不能做这样的事情: myDataGr

我有一个dataGridView,我通过编程创建了一个dataGridView,我希望通过在每行的第一列/单元格中设置toolTipText来为每行设置不同的toolTipText。我知道我可以通过以下方式做到这一点:

myDataGridView.Rows(n).Cells(0).ToolTipText = varContainingText
这个很好用。但是,它仅显示默认时间段(我相信是5秒)。我想设置AutoOpDelay,但似乎不知道如何设置。我似乎不能做这样的事情:

myDataGridView.Rows(n).Cells(0).autoPopDelay = 10000

这不是有效的引用。如何为此设置AutoOpDelay?

您应该为DataGridView使用单独的工具提示,并使用CellMouseEnter事件设置单元格文本。DataGridView.ShowCellToolTips应设置为False

ToolTip toolTip1 = new ToolTip();
//....
private void dgv_Load(object sender, EventArgs e) 
{ 
toolTip1.AutomaticDelay = 100; 
toolTip1.AutoPopDelay= 1000; 
toolTip1.ReshowDelay = 100; 
dgv.ShowCellToolTips = false; 
} 

void dgv_CellMouseEnter(object sender, System.Windows.Forms.DataGridViewCellEventArgs e) 
{ 
    toolTip1.SetToolTip(dgv, dgv[e.ColumnIndex, e.RowIndex].Value.ToString()); 
}