procedure TForm1.Button1Click(Sender: TObject);
var
str:string;
begin
str:=Edit1.text;
if combobox1.Items.IndexOf(str)=-1 then
combobox1.Items.Add(str);
end;
在窗体第一次创建时添加同样道理!
var
str:string;
begin
str:=Edit1.text;
if combobox1.Items.IndexOf(str)=-1 then
combobox1.Items.Add(str);
end;
在窗体第一次创建时添加同样道理!
var
i,j:integer;
begin
j:=i+1;
if combobox1.items.indexof(i)<>combobox1.items.indexof(j) then
combobox1.Items.add;
end;