Forum Discussion
katepaulk
13 years agoOccasional Contributor
Markus,
Thank you so much! As it happens, I think your version of the virtual string tree may be different than the one I'm working with.
The code I used to select a specific row in a virtual string tree (with the column, component, and text to search for passed in elsewhere) has now gone from a mess using position-specific clicks, the DoEdit method, and a whole lot of Keys calls to navigate through the tree to this:
Thank you so much! As it happens, I think your version of the virtual string tree may be different than the one I'm working with.
The code I used to select a specific row in a virtual string tree (with the column, component, and text to search for passed in elsewhere) has now gone from a mess using position-specific clicks, the DoEdit method, and a whole lot of Keys calls to navigate through the tree to this:
Node := Tree.GetFirst(TRUE);
while assigned(node) do begin
// See if the node text matches the text we're after
// If it does, end the routine - we found it.
if Tree.GetText(Node, VarToInteger(Column)-1) = Target then begin
Tree.SetSelected(Node, TRUE);
Result := TRUE;
Exit;
end;
Node := Tree.GetNext(Node, TRUE);
end;
This is so much cleaner and less confusing than the old way.
Related Content
- 14 years ago
- 14 years ago
- 14 years ago
- 14 years ago
Recent Discussions
- 19 hours ago