Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

After Selecting Treeview in windows application

Posted on 2004-04-16
6
Medium Priority
?
441 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 10

Expert Comment

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

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


regards
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 400 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

705 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