//搜索树节点 procedure Tfrm_PM_BoundConfig.Act_lookupExecute(Sender: TObject); var i:integer; Find_Flag:Boolean; s_temp:string; begin if (UserPopedomMenuEnabled(250201)) then begin Application.MessageBox('对不起,您没有执行该操作的权利','系统提示',MB_OK+MB_ICONWARNING); exit; end; Find_Flag:=false; if Trim(cxT_lookupTree.Text)='' then begin application.MessageBox('查询条件不能为空!','系统提示',MB_OK+MB_ICONWARNING); exit; end else begin s_temp:=Trim(cxT_lookupTree.Text); suiTV_values.SetFocus; for i:=0 to suiTV_values.Items.Count-1 do begin if pos(s_temp,suiTV_values.Items[i].Text)>0 then begin suiTV_values.Items[i].Selected:=true; suiTV_values.FindNextToSelect; suiTV_values.OnClick(self); //获得单击事件 Find_Flag:=true; //判断是否一次找到结点 if Application.MessageBox('是否继续查找','系统提示',MB_YESNO)=mryes then begin Continue; end else begin break; end; end; end; if not Find_Flag then application.MessageBox(PChar(Format('没有找到 [%s] ',[s_temp])),'系统提示',MB_OK+MB_ICONWARNING); end; end;
procedure Tfrm_PM_BoundConfig.Act_lookupExecute(Sender: TObject);
var
i:integer;
Find_Flag:Boolean;
s_temp:string;
begin
if (UserPopedomMenuEnabled(250201)) then
begin
Application.MessageBox('对不起,您没有执行该操作的权利','系统提示',MB_OK+MB_ICONWARNING);
exit;
end;
Find_Flag:=false;
if Trim(cxT_lookupTree.Text)='' then
begin
application.MessageBox('查询条件不能为空!','系统提示',MB_OK+MB_ICONWARNING);
exit;
end
else
begin
s_temp:=Trim(cxT_lookupTree.Text);
suiTV_values.SetFocus;
for i:=0 to suiTV_values.Items.Count-1 do
begin
if pos(s_temp,suiTV_values.Items[i].Text)>0 then
begin
suiTV_values.Items[i].Selected:=true;
suiTV_values.FindNextToSelect; suiTV_values.OnClick(self); //获得单击事件 Find_Flag:=true; //判断是否一次找到结点
if Application.MessageBox('是否继续查找','系统提示',MB_YESNO)=mryes then
begin
Continue;
end
else
begin
break;
end;
end;
end;
if not Find_Flag then
application.MessageBox(PChar(Format('没有找到 [%s] ',[s_temp])),'系统提示',MB_OK+MB_ICONWARNING);
end;
end;
我也是用循环实现的
先把TreeView1的信息读出来再操作
TreeView1.SaveToStream();
....
[email protected]