Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • 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: 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.

 
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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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