Private Sub lvinfo_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles lvinfo.MouseMove Dim LVHit As ListViewHitTestInfo Dim ToolTipText As String = "" Dim CurrentPosition As Integer = 0 Dim LastBreakpoint As Integer = 0 Dim ToolTipLengthPerLine As Integer = 40 Try LVHit = lvinfo.HitTest(e.X, e.Y) If LVHit IsNot Nothing Then If LVHit.SubItem IsNot Nothing Then ToolTipText = LVHit.SubItem.Text While CurrentPosition + ToolTipLengthPerLine < ToolTipText.Length LastBreakpoint = ToolTipText.Substring(CurrentPosition, ToolTipLengthPerLine).LastIndexOf(" ") ToolTipText = ToolTipText.Insert(CurrentPosition + LastBreakpoint + 1, vbCrLf) CurrentPosition += LastBreakpoint + 3 End While End If End If mytip.SetToolTip(lvinfo, ToolTipText) Catch ex As Exception strInfoMsg = "Oops! Something is wrong at mouse move." & vbCrLf & "Ex:-" & ex.Message MessageBox.Show(strInfoMsg, "Error Message!", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)