我在网上发现了很多解决方案,但它们不能正常工作,因为StringGrid1.ColumnCount
属性是只读的。我正在使用Delphi 10西雅图。在运行时添加stringgrid列
我有一个StringGrid1,我需要在运行时添加列。具体而言,我必须根据TList的大小添加列。特别是:
var a: TList<double>;
begin
//fill the TList...
for i := 0 to a.Count - 1 do
begin
StringGrid1.AddColumn(); //how can I do this?
end;
end;
我觉得这是拉撒路很容易(但它当然有FPC),但德尔福我真的不知道该怎么办。我正在研究Firemonkey。
“* StringGrid1.ColCount属性是只读的*” - 在FireMonkey中只有这样。 'ColCount'属性是在VCL中读/写的。另外,在FMX中,没有'ColCount'属性,它实际上被命名为'ColumnCount'。下次请指出您正在使用的框架。 –
很难知道你在说什么 –
我没有很好地解释这个问题,但我只需要在TStringGrid中添加一列(TStringColums)。 –