How do i get the font color of a TGroupBox when using vcl styles in XE7? [Edit]

I'm writing a Win32 app in XE7 using the VCL Luna Style. Sometimes a group box will need its caption color changed to alert the user that the data in the group box is required. So it's easy enough to set the StyleElements to [seBorder,seClient]. That allows me to change the font color and style. But then I want to change it back to the original color, the same color as other group box captions that are set to [seFont,seBorder,seClient]. So how do I get the font color of a TGroupBox when using VCL styles?


This is what I've tried:
{code}
procedure TfrmMain.FormCreate(Sender: TObject);
var
  LDetails: TThemedElementDetails;
  LColor: TColor;

begin
  LDetails := StyleServices.GetElementDetails(tlGroupHeaderOpen);

  StyleServices.GetElementColor(LDetails,ecHeading1TextColor,LColor);
  GroupBox1.Font.Color := LColor;
end;
{code}

There are scores of TThemedElementDetails to choose from and I've tried as many as I could that seemed to make sense but tlGroupHeaderOpen and ecHeading1TextColor were the only properties that came close to the right color but it's still not the exact color of a TGroupBox caption color using VCL styles.
0
Barry
10/30/2014 3:28:21 PM
embarcadero.delphi.ide 3925 articles. 0 followers. Follow

3 Replies
1233 Views

Similar Articles

[PageSpeed] 43

Found it!

  LDetails := StyleServices.GetElementDetails( *twCaptionActive* );

  StyleServices.GetElementColor(LDetails,*ecTextColor*,LColor);
0
Barry
10/30/2014 4:05:28 PM
Hello Barry, *

Barry Dirks wrote:
>    LDetails := StyleServices.GetElementDetails( *twCaptionActive* );
>
>    StyleServices.GetElementColor(LDetails,*ecTextColor*,LColor);

Where did you get those values from? I'm still searching a good 
documentation on all that constant for PartID, StateID, PropID etc.; 
ideally with example pictures.

Achim
0
Achim
10/31/2014 12:35:03 PM
All those values are in Vcl.Themes.pas. I scoured Google for answers to this but couldn't find anything definitive so I just put my head down and wrote a little app to start testing all the possible values and found the right one on the 3rd try!
Remember you can always press Ctrl + the left mouse button on a keyword or variable and Delphi will take you to its declaration.
0
Barry
10/31/2014 12:46:55 PM
Reply:

Similar Artilces:

How to get the style of tabs used in Delphi 2010 IDE?
Hi, When you have a project open in the Delphi 2010, each unit has its own tab in the IDE. What component is being used for that? I don't think it is the standard TPageControl, or TTabControl, as those look a bit different. Each tab in the IDE has rounded corners, while the standard components have tabs with squared corners. Anyway, I am not that concerned about the look, but what I would really like to get is the little controls that appear on the right side of the IDE tabs group. If you have a few units (tabs) open, these controls on the right side consist only of a chevron poin...

How to change tree view's (web control) back color, font color and font size using CSS (Cascading Style Shteets)
Hi All, I have created tree view (web control) but i want to change all the properties of it, through single style sheet. Like all other controls (label, text box and combo box) it's not possible to change all the properties of treeview through single style sheet by including it to the contol ???? Please help........ MAITRAY. Sorry. No external css. but these attributes: DefaultStyle="background:#CCCCCC;border:solid 1px;color:black;font-size:8pt" HoverStyle="color:blue;font-name:Arial" SelectedStyle="c...

VCL styles in Delphi XE2
Hi, 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? Thank you, Alex. Hi Alex, We have also come across this issue. I submitted a QC Report - however they believe this is "As Designed"...

Using Delphi 2009, how do I get D2009-style menus?
Hi I've got Delphi 2009, and my project so far is going OK :) I would like to have the same type of menus that Delphi 2009 has - namely, with a colour bar down the left side beside each item. Do I have to do owner draw, or is there some other way to get this? Cheers, Pete Pete Williams wrote: > Hi > > I've got Delphi 2009, and my project so far is going OK :) > > I would like to have the same type of menus that Delphi 2009 has - > namely, with a colour bar down the left side beside each item. > > Do I have to do owner draw, or is there...

Tform with a Parent confused about its position when VCL style is used. [Edit]
When a Tform has its Parent property set to another TWinControl then the form will behave similar to a MDIchild. It will be rendered inside that other WinControl and can be manipulated as usual. The form Top, and Left properties are relative to the parent component rather than the screen. This has worked since Delphi 2.0 at least and works in EX2 provided VCL styles are not being used. However if a VCL style is set using TStyleManager.TrySetStyle(), and any style other than 'Windows' is used, then the child form becomes completely confused as to where its titlebar is, where its ...

Is there a way to force the VCL Styles to ignore the font color property?
Greetings All, I compile my project using a certain VCL style "Smokey Quartz Kamri" When a VCL Style is applied, it changes the behaviour of a two components called TSTSBlinkLabel (Derived from TLabel) and TSTBlinkBtnBtn (Derived form TRzBitBtn) that simply Blinks the text in alternating colors black/red to attract the attention of a user. They no longer blinks. I assume the VCL style overrides the font color property. Is there any way to instruct the VCL Style ignore the TSTBlinkLabel and TSTBlinkBitBtn when it come to the font color? If so, a coding example would be a...

Using C++ Builder XE7, several IDE issues, comments [Edit]
Not sure if I should put one comment per message or not....I've got some issues! 1. I am running Windows 7 32 bit, so I only have 3GB of memory available. I often get a memory error when I go to compile. I close Google Chrome (a memory hog), and I now have 50% of my 3gb available (had 20% available with Chrome running). Try compiling again, memory error. Once I get a memory error, I must exit XE7 and restart, then it will work properly. This takes 3 minutes or so. 2. If I double click on a word (it's now highlighted), then do a search, why is "Search Selection" check...

Delphi XE7 multi-platform
I have a iOS app with a few controls and some code running on the iPhone4 emulator. Now I want to style it. Selecting a TSpeedbutton and right clicking gets the context menu. I select 'Edit Default Style' and the style editor appears, with the buttons across the top, but there is nothing else onscreen. The object inspector shows the speedbutton. 'Load' or 'Add' buttons ask for a file. I can't find any suitable files. I'm stuck. What happens now ? I have read the tutorials for XE4 and XE5. The XE4 tut shows the control depicted in the editor. I see not...

Get Row Style BackGround Colors and Font Size after Grid is databound
Is there a way I can retrieve the row styles after the row is Data bound In my Case I am changing the row Backcolors in Row Data Bound event depending on the Data Once the Databound event is complete I get the Gridview the way I want with Colors and fonts Now I am exporting this grid to Excel and I want to apply same styling to the Rows how do I do it Thanks in advance       Hi khushi2005 , khushi2005:Now I am exporting this grid to Excel and I want to apply same styling to the Rows see my sample about how to export gv to excel with row style. ...

Using C++ Builder XE7, several IDE issues, comments [Edit] #2
Not sure if I should put one comment per message or not....I've got some issues! 1. I am running Windows 7 32 bit, so I only have 3GB of memory available. I often get a memory error when I go to compile. I close Google Chrome (a memory hog), and I now have 50% of my 3gb available (had 20% available with Chrome running). Try compiling again, memory error. Once I get a memory error, I must exit XE7 and restart, then it will work properly. This takes 3 minutes or so. 2. If I double click on a word (it's now highlighted), then do a search, why is "Search Selection" check...

Delphi XE5 "font color" TButton customization on iOS7 [Edit]
On delphi xe5 1) How can I change the font color on a TButton on iOS7 (iPad) default style? 2) How can I export and modify all the default style iOS7 (iPad) ? Thanks for any feedback. Edited by: Giuseppe Amato on Feb 25, 2014 9:18 AM > {quote:title=Giuseppe Amato wrote:}{quote} > On delphi xe5 > 1) How can I change the font color on a TButton on iOS7 (iPad) default style? > 2) How can I export and modify all the default style iOS7 (iPad) ? > Thanks for any feedback. Chris Rolliston discussed how to get the system styles recently on his blog: http://delphihaven.w...

XE7 / Delphi
If I right-click, say TTouches, in the IDE and select [Find Declaration] I am getting an error, "Unable to locate file FMX.Types.pas". I see similar errors (for FXM.Xxx and VCL.Xxx units) while debugging. How can I fix this? I am SERIOUSLY hoping that I'm not going to have to manually add a series of directories to search paths, or anything like that. NOTE: I installed into d:\dev\xe7 Any help [as always] is much appreciated. Thanks! Based on 2 replies, I started by using the "-rtest" command-line switch. This changed nothing. Then I decided to try th...

XE7 / Delphi
If I right-click, say TTouches, in the IDE and select [Find Declaration] I am getting an error, "Unable to locate file FMX.Types.pas". I see similar errors (for FXM.Xxx and VCL.Xxx units) while debugging. How can I fix this? I am SERIOUSLY hoping that I'm not going to have to manually add a series of directories to search paths, or anything like that. NOTE: I installed into d:\dev\xe7 Any help [as always] is much appreciated. Thanks! ...

Delphi XE7 IDE is slow like XE2,XE3,XE4,XE5,XE6 [Edit]
Hello, Same problem on Delphi XE3, XE4 and XE5. Next Delphi XE6 ? Because of Livebinding Delphi IDE is became very very very slow to open Forms with a lot of components. This problem seems to be ignored but opened since Delphi XE2 in Quality Central : Report #: 116169 Report #: 102843 Report #: 103520 Easy to reproduce : Put a lot of third party components like TMSSoftware, DevExpress, Indy etc on a form an it will take a long time to open it and switch on it with F12. Problem is same with a lot of components on form or component with a lot of properties... There i...

Web resources about - How do i get the font color of a TGroupBox when using vcl styles in XE7? [Edit] - embarcadero.delphi.ide

Resources last updated: 12/15/2015 7:52:54 AM