Solved

Balloon ToolTip Popups are offset from the mouse

Posted on 2007-04-04
4
1,394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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