lazarus网格键值对

时间:2015-05-09 16:14:01

标签: delphi freepascal lazarus tstringgrid

在关于grids的lazarus(也可能是delphi)文档中,我们可以找到InsertRow函数的下一个描述:

Function InsertRow
    Inserts a row in the grid and sets
    the Key-Value pair. Returns the
    index of the newly inserted row.

这个键值对是什么?

1 个答案:

答案 0 :(得分:1)

这与TValueListEditor有关,而不是一般的网格。 TValueListEditor在外观上与Delphi Object Inspector 类似。为简洁起见,我将在下文中将其称为 VLE

TValueListEditor.InsertRow有三个参数:

function InsertRow(const KeyName: string; const Value: string; 
  Append: Boolean): Integer;

keyname参数是密钥的名称(VLE的左列)。 Value是关键值(VLE的右列)。它的存储方式与TStrings属性中的Strings key = value对的存储方式相同。例如,使用InsertRow('Testing', '123', False)调用它会存储Testing=123

Append仅控制是否在VLE中任何已选择的项目之前或之后添加新条目。如果VLE为空,则无效。

有关详细信息,请参阅Delphi VCL help