Solved

After Selecting Treeview in windows application

Posted on 2004-04-16
6
437 Views
Last Modified: 2008-02-01
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
Comment
Question by:fatihdurgut
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:EBatista
ID: 10840543
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
 

Author Comment

by:fatihdurgut
ID: 10840675
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
 

Author Comment

by:fatihdurgut
ID: 10840691
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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 10

Expert Comment

by:EBatista
ID: 10841180
this will select the root:

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


regards
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 100 total points
ID: 10843265
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
 

Author Comment

by:fatihdurgut
ID: 10843865
thnks :)
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 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