items.addobject 字符串


procedure TForm1.Button1Click(Sender: TObject);
begin
cbb1.Items.Clear;
cbb1.Items.AddObject('a',TObject(NewStr('a1')));
cbb1.Items.AddObject('b',TObject(NewStr('b1')));
cbb1.Items.AddObject('c',TObject(NewStr('c1')));
cbb1.Items.AddObject('d',TObject(NewStr('d1')));
cbb1.Items.AddObject('e',TObject(NewStr('e1')));
cbb1.Items.AddObject('f',TObject(NewStr('f1')));
end;

procedure TForm1.cbb1CloseUp(Sender: TObject);
var ss:string;
begin
edt1.Text := pstring(cbb1.Items.Objects[cbb1.ItemIndex])^;
end;

posted @ 2019-12-21 10:06  绿水青山777  阅读(270)  评论(0编辑  收藏  举报