Einzelnen Beitrag anzeigen

Crocotronic

Registriert seit: 9. Mai 2013
258 Beiträge
 
#12

AW: StyleBook nur auf bestimmte Objekte anwenden

  Alt 28. Jun 2013, 15:01
Wenn's nicht so geht, dann eben umständlich...

Delphi-Quellcode:
 (o_menu.FindStyleResource('AlternatingRowBackground') as TBrushObject).Brush.Color:= $FF2D2D2D;
 (o_menu.FindStyleResource('background') as TRectangle).Fill.Color:= $FF242323;

 (ListBoxHeader1.FindStyleResource('background') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';

 (ListBoxItem1.FindStyleResource('background_roundall') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem1.FindStyleResource('background_roundbottom') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem1.FindStyleResource('background_roundtop') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem1.FindStyleResource('background_sharp') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem1.FindStyleResource('background_separatorbottom') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 ((ListBoxItem1.FindStyleResource('background_separatorbottom') as TSubImage).FindComponent('subimage1') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';

 (ListBoxItem2.FindStyleResource('background_roundall') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem2.FindStyleResource('background_roundbottom') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem2.FindStyleResource('background_roundtop') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem2.FindStyleResource('background_sharp') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 (ListBoxItem2.FindStyleResource('background_separatorbottom') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 // ****************** Zugriffsverletzung ******************* //
 ((ListBoxItem2.FindStyleResource('background_separatorbottom') as TSubImage).FindComponent('subimage1') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
 // ********************************************************* //
 (ListBoxGroupHeader1.FindStyleResource('background') as TSubImage).SourceLookup:= 'iOSJet Retina2style.png';
So muss ich halt jedes Unterobjekt durchackern. Macht zwar ziemlich Arbeit, aber wer schön sein will muss leiden, oder so.

Nur komm ich an ein Objekt irgendwie nicht dran (im Code oben markiert). Das ist ein unterobjekt vom Seperator-SubImage, auch ein SubImage. Das hat aber weder ein Stylename, noch ein Objektname(?!). Auf dem Bild sieht man den Ausschnitt.
Weiß jemand wie ich da ran komme?

Viele Grüße
Croco

EDIT: Habs, über ((ListBoxItem1.FindStyleResource('background_separ atorbottom') as TSubImage).Children kommt man dran
Miniaturansicht angehängter Grafiken
listbox.png  

Geändert von Crocotronic (28. Jun 2013 um 18:09 Uhr)
  Mit Zitat antworten Zitat