仅在ListView的列标题中显示图标

时间:2009-11-22 12:11:46

标签: delphi listview

当我对ListView的列(asc或desc)进行排序时,我想显示一个图标(向上或向下),因此我将SmallImages属性分配给ImageList(上下两个图标)。我的问题是,当我输入数据时,ImageList中的最新图标显示在ListView的每一行。

PS (ListView.ViewStyle:= vsReport)

1 个答案:

答案 0 :(得分:1)

您可以将每个TListItem上的ImageIndex设置为-1以阻止它们显示图像,但您仍然会有图像所在的间隙。

 with ListView1.Items.Add do
 begin
     Caption := 'Foo';
     ImageIndex := -1;
 end;