怎样将输入的内容与树节点比较,然后树自动展开定位到与输入内容相同的节点。
比如树treeview结构为:
a edit输入的内容为:b2
a1 树就会展开吧光标定位到b2的位置(假设红色为光标颜色)。
a2
a3
b
b1
b2
b3
c
c1
c2
c3
比如树treeview结构为:
a edit输入的内容为:b2
a1 树就会展开吧光标定位到b2的位置(假设红色为光标颜色)。
a2
a3
b
b1
b2
b3
c
c1
c2
c3
解决方案 »
- DBGrid1大问题
- 新年快乐!散分快乐!
- 关于在Tchart中的Bottomaxis如何以时间显示的问题?急!
- vc中的const char *类型在的delphi中与那种数据类型对应呀?谢谢
- 数据库高手请入,解决了,再送300分......
- 所谓二进制编码到底是什么?TStream里面存放的是二进制编码?还是字节流???
- 联想数码相机Show303驱动程序太烂!
- 如何使用DataSet的Locate函数
- del0001
- 数据加密...
- 城里人,你知道真正的猪肉应该是什么样,什么味道吗??
- ~~~~TntEdit,TntMemo等控件有bug嗎,怎麼當輸入的是漢字時只添加了一部分字進數據表裡去呢?那個字段是GoodsMemo 類型大小nvarchar(500)
for i:=0 to treeview1.items.count -1 do
begin
if treeview1.items.item[i].text = 'xxxx' then
treeview1.items.item[i].selected;
end;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;type
TForm1 = class(TForm)
TreeView1: TTreeView;
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
begin for i:=0 to treeview1.items.count -1 do
begin
if treeview1.items.item[i].text = QuotedStr(Edit1.Text) then
treeview1.items.item[i].selected;
end;end;
end.还是不行,帮我看看哪里的问题?
begin
if treeview1.items.item[i].text = QuotedStr(Edit1.Text) then
treeview1.items.item[i].expend;