NavBar's Panel's Section at RunTime?

How do I add controls to a NavBar's Panel's Section?

Example:
bmp:= TTMSFMXBitmap.Create(Section);

Do I have to create them on the panel and somehow assign the section to them?


Hi, 

You can try with the following code:

type
  TTMSFMXNavBarPanelProtected = class(TTMSFMXNavBarPanel);

procedure TForm1.TMSFMXNavBar1ApplyStyleLookup(Sender: TObject);
var
  bmp: TTMSFMXBitmap;
  sec: TTMSFMXNavBarPanelSectionShape;
begin
  sec := TTMSFMXNavBarPanelProtected(TMSFMXNavBar1.Panels[0]).GetSectionShape(TMSFMXNavBar1.Panels[0].Sections[0]);
  bmp := TTMSFMXBitmap.Create(sec);
  //...
  sec.AddObject(bmp);
end;

Kind Regards, 
Pieter

WOW, how would anyone know this. Where is the manual to this component?

This is a workaround to avoid writing loops to find the correct styleresource. There are alternatives if you wish, but it involves Children and ChildrenCount and various calls to FindStyleResource which as all basic FireMonkey style calls.


Kind Regards, 
Pieter

So, is their a manual that exists for this component?

There is no separate manual, but it uses the FireMonkey design philosophy so it is accessible like any other FireMonkey control through the style editor. Using the FindStyleResource functionality will allow you to access the various style elements used in the TMSFMXNavBar.

Kind Regards, 
Pieter