In my program, i made a function which reads a xml of a blog and put the Titles in a TListBox
. But i need to change some properties in TListBoxItem
, like font, height and color, but it doesn't change.
How to set it in runtime ?
repeat
Title := ANode.ChildNodes['title'].Text;
Link := ANode.ChildNodes['link'].Text;
Desc := ANode.ChildNodes['description'].Text;
DataPub := ANode.ChildNodes['pubDate'].Text;
SetLength(Vet_News, Pos + 1);
Vet_Nesw[Pos] := '<h2>'+Title+'</h2>'+Desc;
Itemx := TListBoxItem.Create(self);
Itemx.Text := Title;
Itemx.ItemData.Detail := DataPub;
Itemx.ItemData.accessory := TListBoxItemData.TAccessory.aMore;
Itemx.TextSettings.WordWrap := true;
Itemx.TextSettings.FontColor := TAlphaColorRec.Darkorange;
Itemx.Height := 65;
Itemx.FontColor := TAlphaColorRec.Darkorange; // i tried two ways to change the color
lbNews.AddObject(Itemx); // lbnews is a Tlistbox
Inc(Pos);
ANode := ANode.NextSibling;
until ANode = nil;