Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello

i try to write programm in delphi 2010 that like an dictionary but i have problem in my programm when i type in editbox my typed text search string in treeview nod text and automatically select that or when i type char 'A,a' treeview return node text that start with that char

i write program with Search button but i must type complete word to select that text what i was doing ?
Posted
Comments
Espen Harlinn 11-Jan-11 14:29pm    
eehh?
Amir Mahfoozi 17-Oct-11 7:47am    
:-&

By guessing wildly I would say you are trying to implement an incremental search through the elements of the tree.

Virtual Treeview component[^] does that so well that reimplementing it using the standard "slow" TreeView is a vaste of time.

Virtual Treeview really is a gem, it's a total reimplementation and enormous improvement on the standard TreeView - It's also open source :)

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Jan-11 16:31pm    
Espen, wow, you know Virtual Tree View? -- my 5.
I used to use it in Delphi (actually, I only really valued Ada, Object/Delphi Pascal and C#) and it really helped. There are some minor problems, though. I also had my Unicode support I had to patch Virtual Tree View all the time (only my Unicode method really worked with non-Unicode VCL, published in "The Delphi Magazine").
Don't you know, still no Virtual Tree View for .NET? Would be a great assert...
I you know anything, will you please let me know (or even write an article)?
Espen Harlinn 12-Jan-11 3:43am    
The XtraTreeList control by DevExpress has many similarities, including performance, take a look at: http://www.devexpress.com/Products/NET/Controls/WinForms/Tree_List/
Obviously you compare
Delphi
node.text
with your search term exactly.

you should do something like this :

Delphi
for cnt := 0 to TreeView1.Items.Count - 1 do
  if Pos(lowercase(Search.Text), lowercase(TreeView1.Items[cnt].Text))>0  then
   Node.Selected = true;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900