Search code examples
firemonkeyc++builder-10.2-tokyo

how add TListBoxGroupHeader with code


I have a fmx form with a TListBox on it (C++ Rad Studio). At design time i can right-click on the ListBox and in the Items Editor I can add a GroupHeader. Is it possible to do that in code or is it only an option at design time?

thanks, russ


Solution

  • If your TListBox is called "MyListBox", this is how you would add it to the end of the list in Delphi:

    var
      lListHeader: TListBoxGroupHeader;
    begin
      lListHeader := TListBoxGroupHeader.Create(MyListBox);
      lListHeader.Parent := MyListBox;
    end;