标签:http color io for cti div ar res
//TListView列表拒绝添加重复信息
procedure TForm1.Button1Click(Sender:
TObject);
var
i:
Integer;
begin
if (Trim(Edit1.Text)<>‘‘) then
begin
for i := 0 to
ListView1.Items.Count-1
do
if Trim(Edit1.Text) =
Trim(ListView1.Items[i].Caption) then
begin
Exit;
end;
end;
ListView1.Items.Add.Caption:=Edit1.Text;
end;
function ItemExist(Text:string;ListView:TListView):Boolean;
var
i: Integer;
begin
Result:=False;
if (Trim(Text)<>‘‘) then
begin
for i := 0 to
ListView.Items.Count-1
do
if Trim(Text) =
Trim(ListView.Items[i].Caption) then
begin
Result:=True;
Exit;
end;
end;
Result:=False;
end;
procedure
TForm1.Button6Click(Sender: TObject);
begin
if not
ItemExist(Edit1.Text,ListView1) then
ListView1.Items.Add.Caption:=Edit1.Text;
end;
TListView列表拒绝添加重复信息,布布扣,bubuko.com
标签:http color io for cti div ar res
原文地址:http://www.cnblogs.com/xe2011/p/3876270.html