2013-08-12
展开全部
下面是部分代码,可以看看,作为参考。procedure TForm1.Button1Click(Sender: TObject);
begin
if (ListView1.Items.Item[0].ImageIndex=ImageList1.Count-2) then
begin
ListView1.Items.Item[0].ImageIndex := 0;
ListView1.Items.Item[1].ImageIndex := 1;
end
else
begin
ListView1.Items.Item[0].ImageIndex := ListView1.Items.Item[0].ImageIndex + 1;
ListView1.Items.Item[1].ImageIndex := ListView1.Items.Item[1].ImageIndex + 1;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if (ListView1.Items.Item[0].ImageIndex=0) then
begin
ListView1.Items.Item[0].ImageIndex := ImageList1.Count - 2;
ListView1.Items.Item[1].ImageIndex := ImageList1.Count - 1;
end
else
begin
ListView1.Items.Item[0].ImageIndex := ListView1.Items.Item[0].ImageIndex - 1;
ListView1.Items.Item[1].ImageIndex := ListView1.Items.Item[1].ImageIndex - 1;
end;
end;
begin
if (ListView1.Items.Item[0].ImageIndex=ImageList1.Count-2) then
begin
ListView1.Items.Item[0].ImageIndex := 0;
ListView1.Items.Item[1].ImageIndex := 1;
end
else
begin
ListView1.Items.Item[0].ImageIndex := ListView1.Items.Item[0].ImageIndex + 1;
ListView1.Items.Item[1].ImageIndex := ListView1.Items.Item[1].ImageIndex + 1;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if (ListView1.Items.Item[0].ImageIndex=0) then
begin
ListView1.Items.Item[0].ImageIndex := ImageList1.Count - 2;
ListView1.Items.Item[1].ImageIndex := ImageList1.Count - 1;
end
else
begin
ListView1.Items.Item[0].ImageIndex := ListView1.Items.Item[0].ImageIndex - 1;
ListView1.Items.Item[1].ImageIndex := ListView1.Items.Item[1].ImageIndex - 1;
end;
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询