Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 05-09-2006
DM2005 DM2005 is offline
Miembro
 
Registrado: abr 2005
Posts: 41
Poder: 0
DM2005 Va por buen camino
Recorrer Listbox

Hola a todos, encontre en un hilo a siguiente procedure:

Código Delphi [-]
{$WRITEABLECONST ON}
procedure TForm1.SpeedButton2Click(Sender: TObject);
const
  i: integer = 0;
begin
     with ListBox4 do
        begin
         if i < Count then
          if Items[i] = 'N' then
           begin
             Self.Height := 300;
             Self.Width := 550;
             Self.Left := 400;
             Self.Top := 400;
           end;
          if Items[i] = 'S' then
           begin
             Self.Height := 739;
             Self.Width := 1024;
             Self.Left := 0;
             Self.Top := 0;
           end;
         if i < Count-1 then
            inc(i)
         else
            i:= 0;
        end;
    end;
end;
{$WRITEABLECONST OFF}

esta recorre un listbox, y cuando se encuentra con los item 'N' y 'S', cambia el tamaño del form, la duda es como alterarla para que cuando selecciono un item del listbox (ej.: nº item 22), no recorra el listbox desde el comienzo y si a partir del item que selecciono.
gracias por la ayuda.
Saludos
Responder Con Cita
  #2  
Antiguo 05-09-2006
Northern Northern is offline
Miembro
 
Registrado: ene 2006
Posts: 211
Poder: 19
Northern Va por buen camino
Hola

Miraste la propiedad ItemIndex ? Empieza el bucle desde ahi


Saludos
Responder Con Cita
  #3  
Antiguo 05-09-2006
DM2005 DM2005 is offline
Miembro
 
Registrado: abr 2005
Posts: 41
Poder: 0
DM2005 Va por buen camino
paso a descriir mi procedure,

Código Delphi [-]
procedure TForm1.ListBox1DblClick(Sender: TObject);
begin
  Panel6.Visible := False;
  Panel7.Visible := True;
  if ListBox1.ItemIndex = 0 then
    begin
       ListBox2.Clear;
       ListBox2.Items.LoadFromFile('C:\IPCapitulo.txt');
       ListBox3.Items.LoadFromFile('C:\IPArquivo.txt');
       ListBox4.Items.LoadFromFile('C:\IPMaximizada.txt');
 end;
  if ListBox1.ItemIndex = 1 then
    begin
       ListBox2.Clear;
       ListBox2.Items.LoadFromFile('C:\IPCapitulo.txt');
       ListBox3.Items.LoadFromFile('C:\IPArquivo.txt');
       ListBox4.Items.LoadFromFile('C:\IPMaximizada.txt');
 end;
.
.
.
.
.
end;



Código Delphi [-]
{$WRITEABLECONST ON}
procedure TForm1.SpeedButton2Click(Sender: TObject);
const
  i: integer = 0;
begin
   with ListBox3.Items do
    begin
      if ListBox3.ItemIndex < Count-1
         then ListBox2.ItemIndex := ListBox2.ItemIndex + 1
         else MessageDlg('Você já está no final do curso !',mtInformation,[mbOk],0);
         Panel2.Caption := ListBox2.Items.Strings[ListBox2.ItemIndex];
         WebBrowser1.Navigate(strings[ListBox2.ItemIndex]);
    end;
    begin
     with ListBox4 do
        begin
         if i < Count then
          if Items[i] = 'N' then
           begin
             Self.Height := 300;
             Self.Width := 550;
             Self.Left := 400;
             Self.Top := 400;
           end;
          if Items[i] = 'S' then
           begin
             Self.Height := 739;
             Self.Width := 1024;
             Self.Left := 0;
             Self.Top := 0;
           end;
         if i < Count-1 then
            inc(i)
         else
            i:= ListBox4.ItemIndex;
        end;
    end;
end;
{$WRITEABLECONST OFF}

espero ayude a entender,
gracias
saludos
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
recorrer listbox DM2005 Varios 5 01-09-2006 16:19:20
recorrer listbox para modificar tamaño del form DM2005 Varios 1 15-08-2006 14:11:10
Recorrer Archivo INI Coco_jac OOP 6 27-06-2006 20:01:15
Selección multiple / recorrer listbox miguelml Varios 2 28-04-2006 19:44:02
Recorrer un archivo .rtf blamsa Varios 2 25-05-2005 11:52:48


La franja horaria es GMT +2. Ahora son las 11:29:36.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi