PDA

Ver la Versión Completa : Agregar edit a ListboxItem


look
05-07-2019, 20:24:31
Hola amigos , estoy tratando de agregar un edit a un ListBox, esto es lo que tengo :


procedure TForm3.Button1Click(Sender: TObject);
var
edt: TEdit;
T: TListBoxItem;
begin

edt := TEdit.Create(Self);
edt.Name := 'edt1';
edt.Text := 'hola';
edt.Align := TAlignLayout.Client;

T := TListBoxItem.Create(ListBox1);
T.AddObject(edt);

ListBox1.Items.AddObject('', T);

end;


Al probar el codigo agrega el item, pero el edit no aparece en el item.

que podra ser?

look
05-07-2019, 20:59:11
Hola , me respondo a mi mismo.

esta es la solucion:


ListBox1.AddObject(ListBoxItem);