Ver Mensaje Individual
  #6  
Antiguo 16-01-2007
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.114
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

A mí me queda algo como esto, pero, no me termina de convencer el último "for", puesto que creo que necesitas que se habilite un botón siempre que exista al menos un "item marcado" en la lista, y, de no ser así, que se deshabilite el botón:

Código Delphi [-]
procedure TForm1.CheckListBox1ClickCheck(Sender: TObject);
var
  i: integer;
begin
  if (CheckListBox1.ItemIndex <> -1) then
  begin
    for i := 0 to CheckListBox1.Count-1 do
    begin
      if CheckListBox1.Checked[i]
       and (i <> CheckListBox1.ItemIndex) then
         CheckListBox1.Checked[i] := false;
    end;
  end;
  for i := 0 to CheckListBox1.Count-1 do
  begin
    if CheckListBox1.Checked[i] then
    begin
      BitBtn1.Enabled := true;
      Break;
    end
    else
      BitBtn1.Enabled := false;
  end;
end;
__________________
David Esperalta
www.decsoftutils.com

Última edición por dec fecha: 16-01-2007 a las 18:40:55.
Responder Con Cita