TreeVeiw control 
Author Message
 TreeVeiw control

Hi, everybody:

   I used the treeview control came with the VB5 to keep track of projects.
I want to give the user the  capability to do a search on the projects.
Let's say the user type a project in a text box, by using what property or
method of the TreeView control, I can programmatically select the specific
project in the TreeView and highlight it. Does anybody know whether there is
a way and how? Either post the answer to the news group or send it to me



Fri, 25 May 2001 03:00:00 GMT  
 TreeVeiw control


Fri, 19 Jun 1992 00:00:00 GMT  
 TreeVeiw control
If the ProjectName is a (unique) <node>.Key value in your TreeView, then
simply

        <treeview>.Nodes(ProjectName).Selected = True

If ProjectName appears as a <node>.Text property value, you need to loop
through the Treeview Nodes collection to find it; e.g. something like:-

Private Sub SelectNode (ProjectName as string)

    Dim N as Node

    For Each N in <treeview>.Nodes
        If StrComp (N.Text, ProjectName, vbTextCompare) = 0 then ' FOUND
            N.Selected = True
            Exit For
        End If
    Next N

End Sub

Note that <node>.Selected = True DOES NOT generate a NodeClick Event.

Hope this helps.

Barry Evans
Canberra, Australia
----------------------------

Hi, everybody:

   I used the treeview control came with the VB5 to keep track of projects.
I want to give the user the  capability to do a search on the projects.
Let's say the user type a project in a text box, by using what property or
method of the TreeView control, I can programmatically select the specific
project in the TreeView and highlight it. Does anybody know whether there is
a way and how? Either post the answer to the news group or send it to me



Tue, 29 May 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Drag and Drop on TreeVeiw Control

2. Drag and Drop on TreeVeiw Control

3. Problem with Treeveiw events

4. Controlling Text Control Properties without a Control Array.

5. Accessing control array controls using the controls collection

6. formatting rows and columns in unbound data control, rich text box control, or listbox control

7. Help: Using the datarepeater control with an ActiveX control containing an embedded datacombo control

8. Finding indexes of controls in controls collection

9. DHTML Edit Control, RTF Edit Control, Access 97 Client, SQLServer 7.0 Back End

10. Help: Referencing controls within a tab-control

11. controlling a control on a subform

12. Access97: How to identify a control's associated label control

 

 
Powered by phpBB® Forum Software