I'm trying to change a ListBoxItem's font color at runtime. I'm able to change the color with no issue at design time by using the FontColor property, but I need to change the font color at runtime. The example below is not changing the font color.
var
ListBoxItem : TListboxItem;
begin
ListBoxItem := TlistBoxItem.Create(ListBox1);
ListBoxItem.Text := Edit1.Text;
ListBoxItem.ItemData.Detail := Edit2.Text;
ListBoxItem.StyleLookup := 'listboxitembottomdetail';
ListBoxItem.TextSettings.FontColor := TAlphaColorRec.Blue;
ListBoxItem.Height := 34;
ListBox1.AddObject(ListBoxitem);
end;
The code above is supposed to add an item to ListBox1 with the defined color, but it just adds the item with the default font color.
ListBoxItem.StyledSettings := ListBoxItem.StyledSettings - [TStyledSetting.FontColor];
. – Victoria