Change the style of Firemonkey Listview item button at runtime


I want to change the style of an Accessory button in ListView Item. I’m using a Custom style (Jet style) that is shipped with RAD Studio.
The Accessory Button has 2 style objects. The style names as follows : one is normal(accessorymore), and the other is when the item is selected(accessorymoreselected). Now, the style changes if the Listview item is selected. However, I disabled the selection in the Listview. I want to change the style of when I press the Accessory button itself.
I’ve Added a custom png image named Selected.png for the accessorymoreselected style by utilizing the Bitmap designer using the source link property of the StyleObject.
On the ListViewItemClickEx Event :
TListView(ListView1.Items[ItemIndex].View.FindObject(‘Acc’)).StyleLookup := ‘Selected.png’;

I get an Access violation. How to properly change the style of the accessory button if clicked ?

Comments are closed.