我只能找到如何通过单击组件 -> Items Editor 来创建 ListBoxItem
。
我们如何使用 Firemonkey
以编程方式创建 ListBoxItem
?
最佳答案
只需创建列表框项,并将其添加到列表框:
var
ListBoxItem: TListBoxItem;
begin
ListBoxItem := TListBoxItem.Create(ListBox1);
ListBoxItem.Text := 'foo';
// set other properties of the list box item at this point
ListBox1.AddObject(ListBoxItem);
end;
关于android - 如何以编程方式添加 ListBoxItem?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33284499/