Ver Mensaje Individual
  #1  
Antiguo 12-05-2011
angelp4492 angelp4492 is offline
Miembro
 
Registrado: dic 2007
Posts: 99
Reputación: 0
angelp4492 cantidad desconocida en este momento
Smile Problema con ListView,

Hola como estan, a ver si me pueden ayudar, tengo el siguiente codigo que lo utilizo para subir una posición en un listview la fila seleccionada.

Código Delphi [-]
procedure TFrmMain.BtnSubeClick(Sender: TObject);
var
i,j,k:integer;
aux1,aux2,aux3,aux4:string;
begin
lvcopy.MultiSelect:=false;
lvcopy.SetFocus;

LvCopy.Selected:=Lvcopy.Items[seleccion];


if LvCopy.Selected = nil then
 begin
  application.MessageBox(pchar('No hay Ninguna Selección.'),pchar('Información'), (MB_OK + MB_ICONINFORMATION));
  exit;
 end;
for i:=0 to LvCopy.Items.Count-1 do
  begin
    if LvCopy.Items[i].Selected then
      begin
          if i=0 then exit;
          aux1:=LvCopy.Items[i].SubItems[0];
          aux2:=LvCopy.Items[i-1].SubItems[0];
          aux3:=LvCopy.Items[i].SubItems[1];
          aux4:=LvCopy.Items[i-1].SubItems[1];
          LvCopy.Items[i].SubItems[0]:=aux2;
          LvCopy.Items[i-1].SubItems[0]:=aux1;
          LvCopy.Items[i].SubItems[1]:=aux4;
          LvCopy.Items[i-1].SubItems[1]:=aux3;
          LvCopy.Selected:=Lvcopy.Items[i-1];
          seleccion:=seleccion-1;
         exit;

      end;
  end;

end;

El problema que tengo esque cuando tengo muchos item y me aparece el scrollbar vertical, si quiero subir un item de los ultimos al llegar arriba del listview tengo que ir moviendo el scroll automaticamente para que se vaya mostrando la linea y no se como alguna idea
Responder Con Cita