The control supports incremental searching already. You don't need to add any edit control; just start typing into the tree control, and it will select the next matching node. Set the IncrementalSearch
, IncrementalSearchDirection
, IncrementalSearchStart
, and IncrementalSearchTimeout
properties as needed.
To select the first node that matches given criteria, use IterateSubtree
. Write a method matching the signature of TVTGetNodeProc
to check a single node against your search criteria. It will be called for each node in the tree, and if the node matches, then it should set the Abort
parameter to true. Use the third parameter of IterateSubtree
(named Data
) to communicate the search term to your callback function along with any other search criteria.