Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Balloon tip

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
0
0
GB
Hi all. I now have the following code working to make a tooltip on a listbox item

It work perfectly for a normal tooltip.
If I want it to be a ballon type it shows but flashes even if the mouse is still!!
Can any of you help?


}...the bane of my life!
 
Code:
    Private Sub lstTabs_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstTabs.MouseMove
        Dim MousePositionInClientCoords As Point = New Point(e.X, e.Y)
        Dim indexUnderTheMouse As Integer = Me.lstTabs.IndexFromPoint(MousePositionInClientCoords)
        If indexUnderTheMouse > -1 Then
            Dim s As String = tabTitle(indexUnderTheMouse)
            Dim g As Graphics = Me.lstTabs.CreateGraphics
            If g.MeasureString(s, Me.lstTabs.Font).Width > Me.lstTabs.ClientRectangle.Width Then
                Me.ToolTip1.SetToolTip(Me.lstTabs, s)
            Else
                Me.ToolTip1.SetToolTip(Me.lstTabs, "")
            End If
            g.Dispose()
        End If
    End Sub

}...the bane of my life!
 
Can we introduce any timer control in-between? So that you can control the visible time period to some extent.

Sharing the best from my side...

--Prashant--
 
Tried that as i am currently using
Code:
        Dim MousePositionInClientCoords As Point = New Point(e.X, e.Y)
        Dim indexUnderTheMouse As Integer = Me.lstTabs.IndexFromPoint(MousePositionInClientCoords)
        If indexUnderTheMouse > -1 Then
            Dim s As String = tabTitle(indexUnderTheMouse)
                Me.ToolTip1.SetToolTip(Me.lstTabs, s)
        End If

}...the bane of my life!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top