【发布时间】:2017-03-08 21:05:12
【问题描述】:
我在网上找到了许多解决方案,但它们都不起作用,因为StringGrid1.ColumnCount peoperty 是只读的。我正在使用 Delphi 10 Seattle。
我有一个 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;
我发现在 Lazarus 上这很容易(当然它有 FPC),但在 Delphi 上我真的不知道该怎么做。我正在研究 Firemonkey。
【问题讨论】:
-
"
StringGrid1.ColCount属性是只读的" - 这仅在 FireMonkey 中是正确的。ColCount属性在 VCL 中是读/写的。此外,在 FMX 中,没有ColCount属性,它实际上被命名为ColumnCount。下次请说明您使用的是哪个框架。 -
很难知道你在说什么
-
我没有很好地解释这个问题,但我只需要在 TStringGrid 中添加一列(TStringColums)。
标签: delphi firemonkey delphi-10-seattle