ListView.GetNextItem return error if there only one row in listview and only one row selected.

ListView.GetNextItem return error if there only one row in listview and only one row selected.

Post by pany » Fri, 27 Jun 2003 19:04:20


My enviroment: windows NT4.0, delphi 5,

Here is my code

var ListItem: TListItem;
begin
ListItem := ListView1.Selected;
while assigned(ListItem) do
begin
ListItem := ListView1.GetNextItem(ListItem, sdBelow,
[isSelected]);
end;
end;

I'm only selecting one row in listview1. if the listview1's row count
larger than 1, then after one loop, listitem is nil. but if there is
only one row in the listview, after one loop, ListItem is still the
only row that was selected.

Does i do something error or it's a bug?