Public Class Form1
Private tt As ToolTip
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Creates a DataTable
Dim dt As New DataTable
dt.Columns.Add(New DataColumn("id", GetType(Integer)))
dt.Columns.Add(New DataColumn("description", GetType(String)))
Dim dr As DataRow
For x As Byte = 0 To 50
dr = dt.NewRow()
dr.Item("id") = x.ToString
dr.Item("description") = "Item " + x.ToString
dt.Rows.Add(dr)
Next
' Bound the DataTable to the DataGridView
Me.DataGridView1.DataSource = dt
Me.DataGridView1.ShowCellToolTips = False
' Creates the tooltip and definitions
tt = New ToolTip
With tt
.ReshowDelay = 2000
.InitialDelay = 1000
.AutoPopDelay = 50000
End With
End Sub
Private Sub DataGridView1_CellMouseEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellMouseEnter
If e.ColumnIndex >= 0 And e.RowIndex >= 0 Then
tt.SetToolTip(Me.DataGridView1, Me.DataGridView1(e.ColumnIndex, e.RowIndex).Value.ToString)
Else
tt.RemoveAll()
End If
End Sub
End Class
Private Sub DataGridView1_CellMouseEnter( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) _
Handles DataGridView1.CellMouseEnter
Dim toolTipText As String
If e.ColumnIndex >= 0 AndAlso e.RowIndex >= 0 Then
toolTipText = ""
If Me.DataGridView1(e.ColumnIndex, e.RowIndex).Value _
IsNot Nothing Then
toolTipText = Me.DataGridView1( _
e.ColumnIndex, e.RowIndex).Value.ToString
End If
Me.ToolTip.SetToolTip(Me.DataGridView1, toolTipText)
End If
End Sub
I don't think that is possible but why don't you disable the auto tooltips from the datagridview and add a new tooltip handled by you. That way you can define the time that is showed.