procedure TMyForm.FormCreate(Sender: TObject);
var
Group: TListGroup;
Item: TListItem;
s1, s2: string;
begin
ListView1.ViewStyle := vsReport;
ListView1.GroupView := True;
ListView1.Columns.Add.Caption := 'My column';
Group := ListView1.Groups.Add;
Group.Header := 'My header';
Group.GroupID := 0;
Item := ListView1.Items.Add;
Item.GroupID := 0;
Item.Caption := 'My item';
end
我将上面的代码复制到我的 RAD Embarcadeo delphi 表单代码中。但是为什么在将上面的代码粘贴到 CODE 选项卡上的适当位置后,我没有在表单上自动获取组件...相反,它给出了许多错误,例如
Undeclared identifier TListGroup at line 27
Undeclared identifier TListItem at line 28
Undeclared identifier ListView1 at line 31
Undeclared identifier ViewStyle at line 31
Undeclared identifier vsReport at line 31
Undeclared identifier GroupView at line 32
Undeclared identifier TListGroup at line 27