我有一个具有某些 id 值的 ListView。我正在使用 movemove 方法在工具提示中显示有关此 ID 的其他详细信息。
该代码是用 VB2003 编写的,到目前为止它运行良好。最近我们迁移到 VB2008。
现在工具提示闪烁。详情如下。
希望这对 .NET 大男孩来说是一件容易的事。我是一名 Java EE 开发人员,所以我对自己做错了什么知之甚少(没有)。
编译器设置:目标框架 .NET 2.0
代码:
Dim m_HoveredItem As ListViewItem
Private Sub cancellationList_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles CancellationList.MouseMove
Dim lvi As ListViewItem = Me.CancellationList.GetItemAt(e.X, e.Y)
If Not lvi Is m_HoveredItem Then
m_HoveredItem = lvi
If lvi Is Nothing Then
Me.cancelrejectToolTip.SetToolTip(Me.CancellationList, "")
Else
Dim orderText As String() = lvi.Text.Split("(")
Dim orderRef As Integer = CInt(orderText(0).Trim)
Dim orderIsin As String
Dim orderDesc As String
Dim order As AppOrder= New AppOrder(_server, orderRef)
orderIsin = order.Isin
orderDesc = order.OrderDescription
cancelrejectToolTip.SetToolTip(Me.CancellationList, (orderRef.ToString & "/" & orderIsin & "/" & orderDesc))
End If
End If
End Sub