The detail text color setting of
ListBoxItem is defined in style, so if we want to change the color, we must duplicate a style and then modify its definitions in the
FireMonkey Style Designer ourselves. There is no way to change the color of detail data at design time currently. However, we can customize the style settings by handling some events that will retrive style definitions and then use
FindStyleResource to get an instance of the resource object.
Assume that you have a form with a
To add an item to the ListBox, we must create an
We can modify some properties of the item.
Notice that the detail data is in
And now, if we want to change the detail text color without using the
Style Designer dialog, we can handle the event
After that, apply some pre-defined style to the item.
Finally, add the item to the ListBox, so that it will appear on it.
And here is the final key to achieve our goal.