Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   FireMonkey (https://www.clubdelphi.com/foros/forumdisplay.php?f=50)
-   -   Agregar edit a ListboxItem (https://www.clubdelphi.com/foros/showthread.php?t=94049)

look 05-07-2019 20:24:31

Agregar edit a ListboxItem
 
Hola amigos , estoy tratando de agregar un edit a un ListBox, esto es lo que tengo :

Código Delphi [-]
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:

Código Delphi [-]
  ListBox1.AddObject(ListBoxItem);


La franja horaria es GMT +2. Ahora son las 01:39:14.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi