Treeview problem

Prysson

Registered User.
Local time
Today, 18:26
Joined
Sep 23, 2002
Messages
45
I have a wizard that has two pages to it.

In the first page the user selects an option from a drop down combo box. The value selected fills a treeview in the second page with certain items related to the option chosen.

However when the use click back and changes the item selected in the combo box the treeview does not "refresh" but instead simply adds the new items in addition to the values already populating the treeview nodes.


What I need is a statement that "counts" the nodes of the treeview to determin if the value is greater than 0 and if it does to run some kind of clear function to remove the existing nodes.

I simply dont know what the proper methods and form of the code would look like.

IN short it should function something along the lines of an If Then

If Me!Treeview.Nodes.Count > 0 Then
Me!Treeview.Clear

Else
Rest of code....
End If

Something along those lines but I dont know what the methods are going to be nor do I know the structure of the code because I cant find decent documentation on treeview objects.
 
try this one:

Me!MyTree.Nodes.Clear

Put it before you load the nodes and just substitute your Treeview control name to MyTree.
 

Users who are viewing this thread

Back
Top Bottom