H
hds2008
Unregistered / Unconfirmed
GUEST, unregistred user!
以下来自Delphi的帮助..
procedure TForm1.FormCreate(Sender: TObject);
const
Names: array[0..5, 0..4] of string = (
('Rubble', 'Barney','abc','fxe','xfs'),
('Michael', 'Johnson','def','owj','xje'),
('Bunny', 'Bugs','dxje','jiwj','jo'),
('Silver', 'HiHo','jsiw','xi.''h.eoj'),
('Simpson', 'Bart','ixw','ixwmpo','oxen'),
('Squirrel', 'Rocky','xjie','oytp','woxme')
);
var
I: Integer;
NewColumn: TListColumn;
ListItem: TListItem;
ListView: TListView;
begin
ListView := TListView.Create(Self);
with ListView do
begin
Parent := Self;
Align := alClient;
ViewStyle := vsReport;
NewColumn := Columns.Add;
NewColumn.Caption := 'Last';
NewColumn := Columns.Add;
NewColumn.Caption := 'First';
NewColumn := Columns.Add;
NewColumn.Caption := 'New';
for I := Low(Names) to High(Names) do
begin
ListItem := Items.Add;
ListItem.Caption := Names[0];
ListItem.SubItems.Add(Names[1]);
LIstItem.SubItems.Add(names[2]);
//在添加超过三列的时候,看不到数据啊,请大侠指点一下[?]
LIstItem.SubItems.Add(names[3]);
LIstItem.SubItems.Add(names[4]);
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
const
Names: array[0..5, 0..4] of string = (
('Rubble', 'Barney','abc','fxe','xfs'),
('Michael', 'Johnson','def','owj','xje'),
('Bunny', 'Bugs','dxje','jiwj','jo'),
('Silver', 'HiHo','jsiw','xi.''h.eoj'),
('Simpson', 'Bart','ixw','ixwmpo','oxen'),
('Squirrel', 'Rocky','xjie','oytp','woxme')
);
var
I: Integer;
NewColumn: TListColumn;
ListItem: TListItem;
ListView: TListView;
begin
ListView := TListView.Create(Self);
with ListView do
begin
Parent := Self;
Align := alClient;
ViewStyle := vsReport;
NewColumn := Columns.Add;
NewColumn.Caption := 'Last';
NewColumn := Columns.Add;
NewColumn.Caption := 'First';
NewColumn := Columns.Add;
NewColumn.Caption := 'New';
for I := Low(Names) to High(Names) do
begin
ListItem := Items.Add;
ListItem.Caption := Names[0];
ListItem.SubItems.Add(Names[1]);
LIstItem.SubItems.Add(names[2]);
//在添加超过三列的时候,看不到数据啊,请大侠指点一下[?]
LIstItem.SubItems.Add(names[3]);
LIstItem.SubItems.Add(names[4]);
end;
end;
end;