Ver Mensaje Individual
  #2  
Antiguo 25-11-2010
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.286
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Tal vez deberías "debuggar" ese código paso a paso para saber exactamente dónde salta.
Ayudaría también, por ejemplo, si subieras un pequeño proyecto con el código de generar los botones, junto con este de destruirlos.

En cuanto al código que colocas, yo optaria (para asegurarme) de dividir la condición del IF en dos, y utilizar:

Código Delphi [-]
 if Assigned(...)

Para comprobar que las diferentes propiedades están asignadas.

Código Delphi [-]
Procedure TGesVentasBar.BorrarPanelPersonal;
var
  i: Integer;
begin
  for i:= ComponentCount -1 downto 0 do begin
    if (Components[i] is TSpeedButton) then begin
      if Assigned(TSpeedButton(Components[i]).Parent) then begin
        if Assigned(TSpeedButton(Components[i]).Parent = Personal) then begin
          Components[i].Free;
        end;
      end;
    end;
  end;
end;
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita