Solved

Balloon ToolTip Popups are offset from the mouse

Posted on 2007-04-04
4
1,392 Views
Last Modified: 2008-01-09
I have a application that has a treeview written in vb.net 2005.  When I try to display a balloon tooltip popup, the tooltip doesn't line up with the mouse.  The arrow of the balloon tooltip show up about 2 nodes below of where the mouse is.

The application is like the windows explorer.  It has a MenuStrip, a ToolStrip, a Split Container with a treeview docked in the left panel and a listview docked in the right panel and a statusStrip on the bottom.

Any ideas how to make the Balloon tooltip align properly with the mouse?

Here's my tooltip code:

Public Class Form1
    Private oldNodeIndex As Integer = -1
    Private toolTip1 As ToolTip
'grabbed from: http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c91c.aspx#q928q
    Private Sub TreeView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseMove
        Dim tn As TreeNode = Me.TreeView1.GetNodeAt(e.X, e.Y)
        If Not (tn Is Nothing) Then
            Dim currentNodeIndex As Integer = tn.Index
            If currentNodeIndex <> oldNodeIndex Then
                oldNodeIndex = currentNodeIndex
                If Not (Me.toolTip1 Is Nothing) And Me.toolTip1.Active Then
                    Me.toolTip1.Active = False 'turn it off
                End If
                Me.toolTip1.SetToolTip(Me.TreeView1, String.Format("tooltip: node {0}", oldNodeIndex))
                Me.toolTip1.ToolTipTitle = tn.Index
                Me.toolTip1.Active = True 'make it active so it can show
            End If
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.toolTip1 = New System.Windows.Forms.ToolTip()
        Me.toolTip1.InitialDelay = 500
        Me.toolTip1.ReshowDelay = 0
        Me.toolTip1.IsBalloon = True
        Me.toolTip1.UseAnimation = True
        Me.toolTip1.UseFading = True
    End Sub
End Class


0
Comment
Question by:Pber
  • 2
  • 2
4 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 18851928
I don't think that you can control the location for the ToolTip object.

Bob
0
 
LVL 26

Author Comment

by:Pber
ID: 18857677
Thanks for the info.  You'd think the balloon tooltip arrow align with the mouse.

I did something like this with a custom tooltip class in .net 2003 and that seemed to work.  I'll have to see if I can find that.

Thanks.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 18857715
I would be interested to find anything that would allow that kind of control.  It would definitely go into my bag-o-tricks ;)

Bob
0
 
LVL 26

Author Comment

by:Pber
ID: 18857916
I'll take a look this weekend at home and see if I can find it.  I think it used API's, so that's why I was trying to do it natively with the tooltip object.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question