Recent

Author Topic: ExCheckCtrls - Radio Group Caption color [SOLVED]  (Read 682 times)

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 605
    • Double Dummy Solver - free download
ExCheckCtrls - Radio Group Caption color [SOLVED]
« on: July 12, 2024, 07:54:41 pm »
This nice component colors the button captions, but I haven't figured out how to change the font.color of the radio box's caption.
« Last Edit: July 13, 2024, 12:26:45 am by bobonwhidbey »
Lazarus 3.6 FPC 3.2.2 x86_64-win64-win32/win64

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: ExCheckCtrls - Radio Group Caption color
« Reply #1 on: July 12, 2024, 09:58:20 pm »
Code: Pascal  [Select][+][-]
  1. RadioGroupEx1.Font.Color := clWhite;
Best regards / Pozdrawiam
paweld

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 605
    • Double Dummy Solver - free download
Re: ExCheckCtrls - Radio Group Caption color
« Reply #2 on: July 12, 2024, 11:33:04 pm »
I must be doing something wrong. This didn't work in the sample project I attached..  The caption is still black.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   RG.Font.Color := clWhite;
  4.   RG.Buttons[0].ThemedCaption := false;
  5.   RG.Buttons[1].ThemedCaption := false;
  6.   RG.Buttons[0].Font.Color := clWhite;
  7.   RG.Buttons[1].Font.Color := clWhite;
  8. end;
Lazarus 3.6 FPC 3.2.2 x86_64-win64-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 12457
Re: ExCheckCtrls - Radio Group Caption color
« Reply #3 on: July 13, 2024, 12:16:45 am »
I'm afraid this is not possible because the caption is still drawn by the widget set, and there are restrictions regarding color in some widgetsets.

As a work-around you could
* clear the radiogroup's Caption
* add a TStaticText (not a TLabel) to the form (not to the radiogroup)
* move it to the top/left corner of the radiogroup so that it looks like the original caption.
* Change the font color of the TStaticText as you need.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 605
    • Double Dummy Solver - free download
Re: ExCheckCtrls - Radio Group Caption color
« Reply #4 on: July 13, 2024, 12:25:46 am »
Thanks WP. Yes -  TStaticText was necessary since the top line of the group box can be seen through the TLabel, despite the TLabel.Transparent prop. being set to false.
Lazarus 3.6 FPC 3.2.2 x86_64-win64-win32/win64

 

TinyPortal © 2005-2018