Ver Mensaje Individual
  #6  
Antiguo 26-10-2008
jorge82 jorge82 is offline
Baneado
 
Registrado: jun 2005
Ubicación: Mérida, Yucatán, México
Posts: 75
Reputación: 22
jorge82 Va por buen camino
Parece ser que la "culpa" la tiene el constructor de TCustomPanel, clase de la cual deriva TPanel.

Código Delphi [-]
{ TCustomPanel }

constructor TCustomPanel.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
    csSetCaption, csOpaque, csDoubleClicks, csReplicatable];
  { When themes are on in an application default to making
    TCustomPanel's paint with their ParentBackground }
  if ThemeServices.ThemesEnabled then
    ControlStyle := ControlStyle + [csParentBackground] - [csOpaque];
  Width := 185;
  Height := 41;
  FAlignment := taCenter;
  BevelOuter := bvRaised;
  BevelWidth := 1;
  FBorderStyle := bsNone;
  Color := clBtnFace;
  FFullRepaint := True;
  UseDockManager := True;
end;


como se puede ver en la línea:
Código Delphi [-]
  if ThemeServices.ThemesEnabled then     
    ControlStyle := ControlStyle + [csParentBackground] - [csOpaque];
si los temas de Windows XP estan habilitados en la aplicación, el constructor crea el Panel con el color de su objeto Parent, el cuál casi siempre es un formulario, entonces la solución es "quitarle" esa propiedad al TPanel hmmm digamos al momento de crear el formulario que lo contiene.
Código Delphi [-]
procedure TForm1.FormCreate(Sender: TObject); 
begin   
  Panel1.ControlStyle := Panel1.ControlStyle - [csParentBackground]; 
end;
__________________
Un saludito.
Responder Con Cita