L
linsb
Unregistered / Unconfirmed
GUEST, unregistred user!
大家分析:
procedure TForm1.Button1Click(Sender: TObject);
var
I:integer;
TempBl:boolean;
TempStr:string;
TempPstr:string;
begin
TempBl:=true;
TempPstr:=Edit1.Text;
TempStr:=Edit2.Text;
for I:=0 to ListBox1.Items.Count-1 do
begin
if string(ListBox1.Items.Objects)=TempPstr then
// if ListBox1.Items=TempStr then
TempBl:=false;
end;
if TempBl=true then
ListBox1.Items.AddObject(TempStr,tobject(TempPStr));
// ListBox1.Items.Add(TempStr);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
如果去掉Button2控件,则点击三次button1出错,why?bug?
procedure TForm1.Button1Click(Sender: TObject);
var
I:integer;
TempBl:boolean;
TempStr:string;
TempPstr:string;
begin
TempBl:=true;
TempPstr:=Edit1.Text;
TempStr:=Edit2.Text;
for I:=0 to ListBox1.Items.Count-1 do
begin
if string(ListBox1.Items.Objects)=TempPstr then
// if ListBox1.Items=TempStr then
TempBl:=false;
end;
if TempBl=true then
ListBox1.Items.AddObject(TempStr,tobject(TempPStr));
// ListBox1.Items.Add(TempStr);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
如果去掉Button2控件,则点击三次button1出错,why?bug?