简体   繁体   English

如何用代码添加TListBoxGroupHeader

[英]how add TListBoxGroupHeader with code

I have a fmx form with a TListBox on it (C++ Rad Studio). 我有一个带有TListBox的fmx表单(C ++ Rad Studio)。 At design time i can right-click on the ListBox and in the Items Editor I can add a GroupHeader. 在设计时,我可以右键单击ListBox,然后在“项目编辑器”中添加GroupHeader。 Is it possible to do that in code or is it only an option at design time? 是否可以在代码中做到这一点,还是在设计时只是一个选择?

thanks, russ 谢谢,鲁斯

If your TListBox is called "MyListBox", this is how you would add it to the end of the list in Delphi: 如果您的TListBox称为“ MyListBox”,这就是将其添加到Delphi中列表末尾的方式:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM