我知道当我向集合添加一个集合项时,索引是从零开始的。我想把它设为基于一的,并在一个名为Id的属性中显示值。有没有人能告诉我如何用代码来做这件事?
TCVSClassItem = class(TCollectionItem)
private
fId: Integer;
function GetId: Integer;
public
published
property Id: Integer read GetId;
end;
function TCVSClassItem.GetId: Integer;
begin
result:= ????
end;发布于 2010-12-29 08:10:36
如果我正确理解您的需求,result := Index+1应该这样做
https://stackoverflow.com/questions/4550485
复制相似问题