Solved

After Selecting Treeview in windows application

Posted on 2004-04-16
6
433 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now