Set ParentBackground := False in code (like in the OnCreate) and it'll be fine.
 
example unit and form follows;
 
Compiled in D7 - how anyone could go back to D7 after using D2005 is beyond me...
 
======================
unit xpUnit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, XPMan;
 
type
  TForm1 = class(TForm)
    XPManifest1: TXPManifest;
    Panel1: TPanel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  Panel1.ParentBackground := False;
end;
 
end.
======================
 
object Form1: TForm1
  Left = 319
  Top = 363
  Width = 439
  Height = 316
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  >  PixelsPerInch = 96
  TextHeight = 13
  object Panel1: TPanel
    Left = 32
    Top = 16
    Width = 361
    Height = 129
    Caption = 'Some text here'
    Color = clRed
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindow
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 0
  end
  object XPManifest1: TXPManifest
    Left = 208
    Top = 184
  end
end
 
=======================================
-----Original Message-----
From: Ross Levis [mailto:[EMAIL PROTECTED]
Sent: 19 April 2005 7:56 AM
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] D7 TPanel.Color

I'm converting my D5 app to D7 and I have only one problem.  I have a spashscreen with a small panel displaying some text showing what is loading etc.  I have the Panel Color set to a specific colour which looks fine at design time but changes to the forms colour at runtime.  I am using a Windows XP manifest.  I can't find any properties on the control to fix it.  Should I be using some other control, perhaps a read only TEdit?
 
Regards,
Ross Levis.
 
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to