idea to tooltip in treeview

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

idea to tooltip in treeview

Post by sal21 »

How to tooltip in treview on each node?

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: idea to tooltip in treview

Post by HansV »

What would you like to display in the tooltip?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: idea to tooltip in treview

Post by sal21 »

HansV wrote:
17 Sep 2022, 09:34
What would you like to display in the tooltip?
TEXT of node...

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: idea to tooltip in treview

Post by HansV »

Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: idea to tooltip in treview

Post by sal21 »

TKS bro.

but i need to use the balloon class.
in this case i need to chechk when the old value of nodx is changed resopect the new nodx...

i remember you use in a case the static var.

i just have this two var:

Static F As Long
Static C As Long

my code:

Code: Select all

Private Sub TreeView1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Dim NODX As Node
    Set NODX = TreeView1.HitTest(X, Y)

    If NODX Is Nothing Then
        If m_bInLable Then
            m_bInLable = False
            TT.Title = ""
            TT.TipText = ""
            TT.Destroy
        End If
    Else
        If Not m_bInLable Then
            m_bInLable = True
            TT.Title = "INFO"
            TT.TipText = NODX
            TT.Create Me.TreeView1.hwnd
        End If
    End If

End Sub

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: idea to tooltip in treview

Post by HansV »

I'm afraid I cannot help you with that, sorry.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: idea to tooltip in treview

Post by sal21 »

HansV wrote:
17 Sep 2022, 18:14
I'm afraid I cannot help you with that, sorry.
no problem
:thankyou:

User avatar
SpeakEasy
4StarLounger
Posts: 536
Joined: 27 Jun 2021, 10:46

Re: idea to tooltip in treeview

Post by SpeakEasy »

>i need to check when the old value of nodx is changed resopect the new nodx...

Something like:

Code: Select all

Static OldNODX as Node
Dim NODX As Node
Set NODX = TreeView1.HitTest(X, Y)

If NODX <> OldNodX then
    OldNODX=NODX 
    ' do stuff with NODX
Not this is illustrative, not production code nor anywhere near a complete solution, it's pretty much just showing how you might use a Static for this. In your case you'd also need handle the situation that both NODX and OldNODX are actually Node objects, as otherwise

If NODX <> OldNodX

will error out

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: idea to tooltip in treeview

Post by sal21 »

SpeakEasy wrote:
17 Sep 2022, 22:47
>i need to check when the old value of nodx is changed resopect the new nodx...

Something like:

Code: Select all

Static OldNODX as Node
Dim NODX As Node
Set NODX = TreeView1.HitTest(X, Y)

If NODX <> OldNodX then
    OldNODX=NODX 
    ' do stuff with NODX
Not this is illustrative, not production code nor anywhere near a complete solution, it's pretty much just showing how you might use a Static for this. In your case you'd also need handle the situation that both NODX and OldNODX are actually Node objects, as otherwise

If NODX <> OldNodX

will error out
Attached my test project.

the balloon work only on the first node(2022) and second node(01-GENNAIO)!
You do not have the required permissions to view the files attached to this post.