I create a simple application,
for Delphi XE2 Firemonkey I have problem to load an image to TListBoxItem
!
I tried, this steps:
Code On Button Click:
var
xItem : TListBoxItem;
begin
xItem := TListBoxItem.Create(nil);
xItem.Parent := ListBox1;
xItem.Height := 90; // just for test !
// code to load image file [edit1.Text] !!
xItem.Text := edit2.Text;
end;
Off the top of my head:
var Image: TImage;
...
Image := TImage.Create(xItem);
Image.Parent := xItem;
Image.Bitmap.LoadFromFile(<FileName>);
Image.Align := TAlignLayout.alClient; //(Not strictly necessary but guarantees images will not be positioned out of view).