Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 445
  • Last Modified:

After Selecting Treeview in windows application

Hello,
i'm trying to make a mdi application wint vb.net,
i create a treview control on main form, users opens subforms by this treeview,
when a user click on a node AfterSelect event runs but
at the second time, it isn't work because node is already selected,
how can i unselect the active node in afterselet event handler ?
thanks
0
fatihdurgut
Asked:
fatihdurgut
  • 3
  • 2
1 Solution
 
EBatistaCommented:
you can do it by selecting a different node at run time but it will rise the AfterSelect event again.
why do you need that for?

0
 
fatihdurgutAuthor Commented:
in my after select event i open sub forms,
after user select the node a sub form open,
after a while if the user close the form, and again click the same nose
if it is already selected then it isn't open the form,
because after select event isn't work,
becouse it is already selected
0
 
fatihdurgutAuthor Commented:
i want to select root node when the user click any sub node,
by this trick  if the user click the same node second or third time it opens sub form again
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
EBatistaCommented:
this will select the root:

Me.TreeView1.SelectedNode=Me.TreeView1.Nodes(0)


regards
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You can unselect the node after it has been selected like this:

    Private Sub TreeView1_AfterSelect1(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
        ' Do some stuff in here
        TreeView1.SelectedNode = Nothing
    End Sub

Regards,

Idle_Mind
0
 
fatihdurgutAuthor Commented:
thnks :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now