Hola,
No has respondido a lo que te pregunto, pero, en todo caso, a bote pronto me sale algo como lo siguiente. Puedes adaptarlo a tu gusto. Son bienvenidas todas las rectificaciones que sean menester.
Código Delphi
[-]
function MoverElementoListBox(listBox: TCustomListBox;
moverElementoHaciaArriba: boolean) : boolean;
var
textoElemento: string;
indiceActual: integer;
indicePosterior: integer;
begin
if not Assigned(listBox) then
raise Exception.Create('Es necesario un objeto TCustomListBox válido');
indiceActual := listBox.ItemIndex;
if(indiceActual = -1) then
begin
Result := false;
Exit;
end;
if moverElementoHaciaArriba then
indicePosterior := indiceActual-1
else
indicePosterior := indiceActual+1;
if (indicePosterior = -1)
or (indicePosterior > listBox.Count-1) then
begin
Result := false;
Exit;
end;
listBox.ItemIndex := indicePosterior;
textoElemento := listBox.Items[indicePosterior];
listBox.Items[indicePosterior] := listBox.Items[indiceActual];
listBox.Items[indiceActual] := textoElemento;
Result := true;
end;
MoverElementoListBox(lbElementos, true);
MoverElementoListBox(lbElementos, false);