Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Balloon ToolTip Popups are offset from the mouse

Posted on 2007-04-04
4
Medium Priority
?
1,403 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

722 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