Delphi中与Treeview的Editbox关系 [英] Editbox relation with treeview in delphi

查看:71
本文介绍了Delphi中与Treeview的Editbox关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我尝试在delphi 2010中编写像字典一样的programm,但是当我在editbox中键入我在treeview点头文本中键入的文本搜索字符串并自动选择该字符时,或者当我键入char``A,a''treeview时,我在Programm中遇到问题返回以该char开头的节点文本

我使用搜索"按钮编写程序,但我必须键入完整的单词以选择该文本,我在做什么?

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 ?

推荐答案

凭空猜测,我会说您正在尝试实现一个通过树的元素进行增量搜索.

虚拟树视图组件 [ ^ ]的效果如此之好,以至于使用标准的慢速" TreeView重新实现它需要花费大量的时间.

虚拟Treeview确实是一颗宝石,它是对标准TreeView的完全重新实现和巨大改进-它也是开源的:)

问候
Espen Harlinn
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


很显然,您将
node.text

与您的搜索字词进行了精确比较.

你应该做这样的事情:

with your search term exactly.

you should do something like this :

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


这篇关于Delphi中与Treeview的Editbox关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆