EugeneK 19 Posted August 21, 2023 Hi Say I have following simple component, in runtime it shows it as blue, but in design time in has default color, how to fix it? unit UTestPanel; interface uses System.Classes, Vcl.Controls, Vcl.ExtCtrls; type TBluePanel = class(TPanel) strict private FPanel: TPanel; public constructor Create(AOwner: TComponent); override; end; procedure Register; implementation uses System.UITypes, Vcl.Forms; constructor TBluePanel.Create(AOwner: TComponent); begin inherited; FPanel := TPanel.Create(Self); FPanel.Parent := Self; FPanel.Align := alClient; FPanel.ParentBackground := False; FPanel.ParentColor := False; FPanel.Color := TColors.Blue; end; procedure Register; begin RegisterComponents('TestObjects', [TBluePanel]); end; end. Share this post Link to post
Achim Kalwa 61 Posted August 21, 2023 1 hour ago, EugeneK said: in runtime it shows it as blue, but in design time in has default color, how to fix it? It is not your code, it is the IDE's form designer which ignores the color. Please try Tools->Options->User Interface->Form Designer and uncheck the "Enable VCL Styles" option. 1 Share this post Link to post
dwrbudr 8 Posted August 22, 2023 Or simply remove seClient from the inner panel StyleElements Share this post Link to post