Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED] Text Coloring not working on Win X
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Qt does not position form...
by
systemgvp
[
Today
at 03:47:15 pm]
Getting name / line of ca...
by
simone
[
Today
at 03:29:14 pm]
Application.QueueAsyncCal...
by
Thaddy
[
Today
at 03:17:23 pm]
FPC Unleashed (inline var...
by
Fibonacci
[
Today
at 02:03:21 pm]
Windows API Hooking/DLL I...
by
Thaddy
[
Today
at 01:08:56 pm]
How do 'with' statements ...
by
Thaddy
[
Today
at 01:00:07 pm]
TComboBoxEx & TCheckCombo...
by
Paolo
[
Today
at 11:28:00 am]
DataPort or Synpase stat...
by
serbod
[
Today
at 09:30:51 am]
SynEdit auto End of line ...
by
Martin_fr
[
Today
at 09:08:36 am]
Show Case: WritingTool
by
ginoo
[
Today
at 08:47:02 am]
How to view the TODO list...
by
Thaddy
[
Today
at 07:16:27 am]
Scripts to generate ofici...
by
dbannon
[
Today
at 02:25:56 am]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[
Today
at 01:20:44 am]
International Pascal Cong...
by
Mike.Cornflake
[May 09, 2026, 06:45:37 pm]
SpreadSheet Add Chart Lin...
by
eldonfsr
[May 09, 2026, 06:19:33 pm]
How to access inherited m...
by
Thaddy
[May 09, 2026, 04:12:38 pm]
Anubis activated
by
LemonParty
[May 09, 2026, 03:46:01 pm]
RunFormula: math expressi...
by
LeP
[May 09, 2026, 03:39:53 pm]
Setting canvas offset wit...
by
jamie
[May 09, 2026, 03:14:04 pm]
Limiting Search in TSelec...
by
jamie
[May 09, 2026, 03:09:21 pm]
using make with a differe...
by
Thausand
[May 09, 2026, 02:41:39 pm]
FreeBSD 13/14: RTL dirent...
by
Fred vS
[May 09, 2026, 02:33:11 pm]
Problems with form.AutoSc...
by
OH1KH
[May 09, 2026, 12:07:44 pm]
AVRPascal – free code edi...
by
ackarwow
[May 09, 2026, 09:23:14 am]
Can /my/ AI help me with ...
by
valdir.marcos
[May 09, 2026, 08:34:18 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Text Coloring not working on Win X (Read 1273 times)
Slyde
Full Member
Posts: 152
[SOLVED] Text Coloring not working on Win X
«
on:
December 20, 2020, 07:18:54 pm »
This code works fine on Linux Mint:
Code: Pascal
[Select]
[+]
[-]
j
:
=
1
;
for
i
:
=
1
to
20
do
begin
tec
:
=
Form1
.
FindComponent
(
'AMC_Edit'
+
IntToStr
(
i
)
)
;
if
tec is TEdit
then
for
k
:
=
1
to
4
do
begin
rcbc
:
=
Form1
.
FindComponent
(
'AMC_RadioButton'
+
IntToStr
(
j
)
)
;
Inc
(
j
)
;
if
(
(
tec as TEdit
)
.
Text
<>
(
rcbc as TRadioButton
)
.
Caption
)
and
(
rcbc as TRadioButton
)
.
Checked
then
begin
(
rcbc as TRadioButton
)
.
Font
.
Color
:
=
clRed
;
end
;
end
;
end
;
But on Windows, when I run it thru the debugger, I see line 12 execute, but the font color never changes to red. What am I doing wrong?
«
Last Edit: December 20, 2020, 07:39:39 pm by Slyde
»
Logged
Linux Mint 21.3
Lazarus 3.0
wp
Hero Member
Posts: 13502
Re: Text Coloring not working on Win X
«
Reply #1 on:
December 20, 2020, 07:33:51 pm »
Because the LCL components are painted by the widgetset there is limited control. In case of Windows you cannot change the text color of a TRadioButton. The object inspector has a page "Restrictions" listing the properties which cannot be changed in the current widgetset.
If you absolutely need a radiobutton with colored text you could install the package ExCtrls (available via OPM) which contains custom drawn radiobuttons/checkboxes and offers a lot of flexibility (and is cross-platform, of course):
https://wiki.lazarus.freepascal.org/ExCtrls#TRadioButtonEx.2C_TCheckBoxEx.2C_TRadioGroupEx_and_TCheckGroupEx
.
Logged
Slyde
Full Member
Posts: 152
Re: Text Coloring not working on Win X
«
Reply #2 on:
December 20, 2020, 07:39:13 pm »
Thanks for the heads up, wp. I have that package installed, just haven't used anything out of it. I'll check it out. Thanks again.
Logged
Linux Mint 21.3
Lazarus 3.0
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED] Text Coloring not working on Win X
TinyPortal
© 2005-2018