Solved

Balloon ToolTip Popups are offset from the mouse

Posted on 2007-04-04
4
1,389 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now