Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview search

Status
Not open for further replies.

Salmano

Programmer
Oct 4, 2001
34
0
0
RO
Hi all !
I fill a treeview control with some values. The user searches in the .text for some value. I want to select the found node, expanding the parent nodes. The code looks like this:

with thisform.treeview
for i = .SelectedItem.index to .nodes.count
node_text = .nodes.item(i).parent.text
if searched_text $ node_text then
foundit = .T.
&& HERE SHOULD BE THE CODE FOR SELECTING THE FOUND NODE
exit
endif
endfor
endwith


Thanks !
Salmano
 
You can use the Expanded property to programmatically expand a Node object. The following code has the same effect as double-clicking the first Node:

TreeView1.Nodes(1).Expanded = True

When a Node object is expanded, the Expand event is generated.

If a Node object has no child nodes, the property value is ignored. Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top