Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Styles    [ Add a report in this area ]  
Report #:  100645   Status: Closed
Style does not honor specific color of a control (TEdit, TMemo etc)
Project:  Delphi Build #:  16.0.4316.44803
Version:    16.0 Submitted By:   Lukasz Rewak
Report Type:  Basic functionality failure Date Reported:  11/1/2011 6:35:39 PM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   288649
Resolution: As Designed (Resolution Comments) Resolved in Build: :
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Style does not honor specific color of a control (TEdit, TMemo etc) when you select 'Default Style' to ANY other style other than Windows.

Please try attached sample project.
Steps to Reproduce:
Create a form with a TEdit, set the color of the control to a specific color (clRed). Run the application with a Style enabled and the control does not draw in the specified color.

This issue occurs when you select 'Default Style' to ANY other style other than Windows.
Workarounds
None
Attachment
VCSStyleTest.zip
Comments

Tomohiro Takahashi at 11/1/2011 9:19:34 PM -
> ... with a Style enabled ...
What sytle do you select as 'Default style' in project option, for exmaple Windows, Carbon, etc...?

Lukasz Rewak at 11/3/2011 11:11:33 PM -
The behaviour is the same if you select 'Default style' as Windows, then change the style once the application has started using TStyleManager.SetStyle.

Or if you select 'Default Style' to ANY other style other than Windows.

The Colors of any components are not "kept" - the style seems to override them.

Rodrigo Ruz at 2/6/2012 1:50:22 PM -
Lukasz, try this article http://theroadtodelphi.wordpress.com/2012/02/06/changing-the-color-of-edit-controls-with-vcl-styles-enabled/

Tomohiro Takahashi at 11/4/2011 12:53:24 AM -
Unfortunately, I can not reproduce your issue.
So, could you please attach sample project by using Windows Native QC Client? The standalone client comes with Delphi.

Lukasz Rewak at 11/6/2011 2:50:25 PM -
I have attached a sample project. It will run with a Style enabled. If you switch to Windows, the colors show again. There is also a PNG file in the zip attached.

Wieslaw Malecki at 11/7/2011 8:09:54 AM -
I also confirm this error.  Maybe a reason is the incorrect interpretation of the transparency (the alpha channel) at reading in the picture.

Wieslaw Malecki at 11/7/2011 8:21:28 AM -
I am sorry  but my comment above concerns the report 99936 and hit here by mistake

Seppy Bloom at 11/7/2011 10:00:04 AM -
This is as designed. The point of using a custom style is to change the appearance of controls to follow a pre-defined, uniform color scheme.

Lukasz Rewak at 11/7/2011 9:55:50 PM -
Really? I agree that controls should follow pre-defined custom style - but ONLY if you have clWindow (or any system color) set. It should change its appearance if the color was set to "clWindow" - similar to how it works now - if you have clWindow set it changes according to the "system" colors - but if you override it to a specific color, it stays as you set it.
Is there a way to "override" the custom style in then?

Seppy Bloom at 11/10/2011 9:13:02 AM -
Really! This is how the Styles feature is intended to work, and really the only way that makes sense.

Delphi Workgroup at 11/11/2011 6:48:48 AM -
Sorry but Styles in that way are absolutely useless.
What if I want to display a panel that blinks and change colors ? We compile about 5 millions lines of code, a lot of forms have panels that show colors... do you think I have to implement a workaround and/or owner draw in some hundred forms ?

Alex Kononov at 11/8/2011 7:47:10 AM -
We have the same problem...
https://forums.embarcadero.com/thread.jspa?threadID=63642&tstart=0

I've tried to prepare simple application with TButton and TPanel;

procedure TForm1.btnMakeRedClick(Sender: TObject);
begin
pnlMain.Color := clRed;
end;

It works when i do not choose any VCL styles in the project settings;
If i tried to use any of additional themes i can't change TPanel's color.
We have large project with the same code logic, can i use vcl styles and keep color change functionality at the same time?

Please fix it!

Jefry Suarez at 1/2/2012 1:00:07 AM -
Same problem here, please fix!

Marc Alinski at 1/8/2012 7:59:52 AM -
I have written a workaround for TPanel.

Look at: http://dev.bvasystem.de/2012/01/hintergrundfarbe-eines-tpanels-andern/

Server Response from: ETNACODE01