pin_plunder
asked on
How to move a lis item in a list view
well. I believe the title says it all.
I've added to buttons Up and Down, which I'm trying to let the user organize the items displayed in the list view.
Though I tried and tried I can't make it work. What can I do?
I would like source code please.
Thanks.
I've added to buttons Up and Down, which I'm trying to let the user organize the items displayed in the list view.
Though I tried and tried I can't make it work. What can I do?
I would like source code please.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your help
procedure TForm1.buttonUpClick(Sende
var x: integer;
s1, s2: string;
begin
x := lstbox.ItemIndex;
if x >= 1 then
begin
s1 := lstbox.Items.Strings[x];
s2 := lstbox.Items.Strings[x-1];
lstbox.Items.Strings[x] := s2;
lstbox.Items.Strings[x-1] := s1;
lstbox.ItemIndex := x-1;
end;
end;