Einzelnen Beitrag anzeigen

Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#2

AW: Hintergrundfarbe eines selektierten FMX ListViewItems ändern

  Alt 26. Jul 2018, 16:58
Zitat:
You have to use a style. So add a stylebook en either use one of the
styles that come with Delphi or right click the listview "edit custom
style"to make the style. dubbleclick on the stylebook to open the style
and modify the listviewstyle.
Hopes that helps
Me hope das auch

auch was mit Code auf SO entdeckt in Form einer Bitmap:
Zitat:
My suggestion is to add TListItemImage to listview, use it as a marker or set its bounds to cover whole item and use it as a backgraund. Then when you click on item, change the image assigned to the listitemimage object of the selected item.
for example:
Delphi-Quellcode:
procedure TForm1.lvListasItemClickEx(const Sender: TObject; ItemIndex: Integer;
  const LocalClickPos: TPointF; const ItemObject: TListItemDrawable);
begin
TListItemImage(TListViewItem(lvListasItem.Selected).Objects.FindDrawable('Image1')).Bitmap := Image1.MultiResBitmap.Items[1].Bitmap;
end;
Gruß vom KodeZwerg

Geändert von KodeZwerg (26. Jul 2018 um 17:02 Uhr)
  Mit Zitat antworten Zitat