check if i click on minus or plus sign in treeview

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

check if i click on minus or plus sign in treeview

Post by sal21 »

How to check when i click on minus or plus sign in treeview?
You do not have the required permissions to view the files attached to this post.

User avatar
SpeakEasy
5StarLounger
Posts: 607
Joined: 27 Jun 2021, 10:46

Re: check if i click on minus or plus sign in treeview

Post by SpeakEasy »

Well, when you click a +, then that branch of the tree expands, and when you cliock on a minus, it collapses.

Perhaps the Treeview control has events that match this behaviour ...

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

Re: check if i click on minus or plus sign in treeview

Post by sal21 »

SpeakEasy wrote:
28 Jun 2024, 15:33
Well, when you click a +, then that branch of the tree expands, and when you cliock on a minus, it collapses.

Perhaps the Treeview control has events that match this behaviour ...
now...
i need to know only if i have clicked on + or -, no other action

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

Re: check if i click on minus or plus sign in treeview

Post by HansV »

Code: Select all

Private Sub TreeView1_Collapse(ByVal Node As MSComctlLib.Node)
    Debug.Print "-"
End Sub

Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
    Debug.Print "+"
End Sub
Best wishes,
Hans

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

Re: check if i click on minus or plus sign in treeview

Post by sal21 »

HansV wrote:
28 Jun 2024, 16:36

Code: Select all

Private Sub TreeView1_Collapse(ByVal Node As MSComctlLib.Node)
    Debug.Print "-"
End Sub

Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
    Debug.Print "+"
End Sub
super!
tks bro