TMSFMXTileList Header/Footer

I am creating a TMSFMXTileList component at run time (in the FormCreate event).

I want to disable the header, and added something like :

header := TileList.GetHeader;

if Assigned(header) then

header.visible := false;

header is always NIL (unassigned), so it doesn't work.

I moved the above code to the FormActivate event, but it still doesn't work.

If I place the TileList component on the form in the designer, it works (only when the above code is in the FormActivate event).

I guess that the header/footer hasn't been created at the time I try to access/modify it.

Where/How should I be doing this ?

I'm new to firemonkey (all my previous Delphi work has been VCL based).


To make sure the header and footer are loaded from the style file when you want to make changes you need to call NeedStyleLookup and ApplyStyleLookup before getting the header and footer in the constructor of the form, or you can move the code to the OnApplyStyleLookup event

Kind Regards,

PieterPieter Scheldeman2016-01-14 17:59:10

Many thanks Pieter - That solved it for me.