Recent

Author Topic: TRadioGroup font does not accept chosen color  (Read 3301 times)

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: TRadioGroup font does not accept chosen color
« Reply #15 on: May 25, 2020, 10:05:26 pm »
This is already possible as you can see at the demo. However, you must do this at runtime by changing the Font.Color of the Buttons[index]. Having this available at designtime would make the component much more complicated
Code: Pascal  [Select][+][-]
  1.   RadioGroupEx1.Buttons[0].Font.Color := clRed;

TeoUrbana

  • New Member
  • *
  • Posts: 43
    • Distração For Fun
Re: TRadioGroup font does not accept chosen color
« Reply #16 on: May 26, 2020, 03:48:02 am »
Yes.
The buttons are working fine.
I speak of caption (RadioGroup.caption). It does not change its color yet.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: TRadioGroup font does not accept chosen color
« Reply #17 on: May 26, 2020, 06:58:54 pm »
Looks like you found an anchor  :P

Code: Pascal  [Select][+][-]
  1.          SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT));
  2.             SelectObject(DC, GroupBox.Font.Reference.Handle);        
  3.  
as you can see there.. it is getting the Systems color for graytext, what ever that is  for the day.

if you turn off your themes it appears to work as you wish..
maybe there should be a property per control to accept Themes.
« Last Edit: May 26, 2020, 07:05:52 pm by jamie »
The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: TRadioGroup font does not accept chosen color
« Reply #18 on: May 26, 2020, 07:51:37 pm »
what ever that is  for the day.
Read the comment a few line higher.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: TRadioGroup font does not accept chosen color
« Reply #19 on: May 26, 2020, 08:59:11 pm »
yeah I notice that, only when the control is disabled..  >:(

but it appears the Themes is getting checked down stream so it is still drawing it via OS colors.

EDIT
  I see the message was already pumped to the control before testing the Themes and disable settings so there is obviously a crutch in original message handler.

« Last Edit: May 26, 2020, 09:06:01 pm by jamie »
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018