Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   FireMonkey Styles: wer kennt sich aus? (https://www.delphipraxis.net/179797-firemonkey-styles-wer-kennt-sich-aus.html)

bcvs 3. Apr 2014 14:25

AW: FireMonkey Styles: wer kennt sich aus?
 
So, jetzt habe ich es doch noch selbst rausgefunden, mit Hilfe von diesem Beitrag:
https://forums.embarcadero.com/threa...27830򙑶

Man darf keine Daten in die Resource reinschreiben, die dauerhaft da bleiben sollen. Die korrekte Stelle für das Befüllen des LixtBoxitems ist sein Ereignis OnApplyStyleLookup. So funktioniert es jetzt im Prinzip:

Delphi-Quellcode:
 
  lbGericht.BeginUpdate;
  for i := 0 to 50 do begin
    lbi:=TListBoxItem.Create(lbGericht);
    lbi.Parent:=lbGericht;
    lbi.Text:='Item ' + IntToStr(i);
    lbi.Tag:=i;
    lbi.OnApplyStyleLookup:=ListBoxItem1ApplyStyleLookup;
  end;
  lbGericht.EndUpdate;

procedure TMainForm.ListBoxItem1ApplyStyleLookup(Sender: TObject);
var lbi:TListBoxItem;
    ItemText   : TText;
begin
  lbi:=TListBoxItem(Sender);
  ItemText := lbi.FindStyleResource('TextDatum') as TText;
  if Assigned(ItemText) then
    ItemText.Text := IntToStr(lbi.Tag);
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:06 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz