
Can someone please direct me in the right direction. I am trying to create a custom ListboxItem using Delphi XE4 for an iOS application. The output of my target will be something like the line above where I am stuck right now (image below).

I managed to dynamically generate a ListBoxItem and insert a TLabel object, however I cannot change the fontColor TLabel property to the desired color. I can encode
TLabel.Fontcolor: = ClaBlue;
But the color goes back to black. I would ideally want it to look the same as the example I am giving. I'm having problems changing the font color of the inserted TLabel and adding a gradient background to each list item. I do not know if I need to use the "style editor" or even how. And yes, I looked at the sample included in Delphi / RAD Studio. Here is my current encoding below:
while XMLNode<>nil do begin HeaderText := 'Part#: ' + XMLNode.ChildNodes['PARTNUM'].Text + Chr(9) + XMLNode.ChildNodes['VENDPARTNUM'].Text; DetailText := '$' + XMLNode.ChildNodes['MD1_SELL_PRICE'].Text + ' /' + XMLNode.ChildNodes['UM1_PRICE_NAME'].Text + sLineBreak + 'Min: ' + XMLNode.ChildNodes['md2_from.MD2_MIN_QTY'].text + Chr(9) + 'On Hand: ' + XMLNode.ChildNodes['md2_from.MD2_ON_HAND_QTY'].text + Chr(9) + Label1.text ; Form6.ListBox1.Items.Add(DetailText); ListBoxItem:=Form6.ListBox1.ListItems[Form6.ListBox1.Items.Count-1]; ListBoxItem.StyleLookup:='listboxitembottomdetail'; ListBoxItem.WordWrap:=True; ListBoxItem.Font.Size:= 8; ListBoxItem.Height := 120; TestLabel := TLabel.Create(self); TestLabel.Text := HeaderText; TestLabel.font.size := 20; testLabel.FontColor := claBlue; TestLabel.Width := form6.ListBox1.ClientWidth; i := i +1; XMLNode := XMLNode.NextSibling; end; Form6.ListBox1.EndUpdate; Form6.Show;
source share