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
Version 4.8 was recently ...
by
Ten_Mile_Hike
[
Today
at 01:43:17 am]
Who can explain this ?
by
J-G
[
Today
at 01:02:01 am]
Discipline your AI coding...
by
avra
[
Today
at 12:19:27 am]
FPC Unleashed (inline var...
by
Fibonacci
[
Today
at 12:03:13 am]
[New Component] ExtTabCtr...
by
d7_2_laz
[June 10, 2026, 10:52:55 pm]
Conscious Artificial Inte...
by
schuler
[June 10, 2026, 09:11:29 pm]
TDWEdit
by
Ed78z
[June 10, 2026, 08:24:43 pm]
Trayslate 1.3.0 - Free tr...
by
AlexanderT
[June 10, 2026, 08:12:24 pm]
TShellListView
by
Ed78z
[June 10, 2026, 07:59:41 pm]
[SOLVED] Curious why this...
by
1HuntnMan
[June 10, 2026, 07:53:21 pm]
IndySecOpenSSL is now ava...
by
Thaddy
[June 10, 2026, 06:24:37 pm]
Toying Pascal Documenting...
by
paule32
[June 10, 2026, 05:22:32 pm]
Gitlab site history date.
by
Fred vS
[June 10, 2026, 05:07:59 pm]
Cursor changes to arrow o...
by
atlatl
[June 10, 2026, 05:02:45 pm]
Sizes and SizeInt
by
440bx
[June 10, 2026, 02:15:13 pm]
how to add a ForEach call...
by
jamie
[June 10, 2026, 12:42:04 pm]
XLibre, finally and fortu...
by
kagamma
[June 10, 2026, 12:15:10 pm]
[SOLVED] Watches panel is...
by
CM630
[June 10, 2026, 12:06:33 pm]
How to monitor changes in...
by
Martin_fr
[June 10, 2026, 11:55:18 am]
Printer Info
by
J-G
[June 10, 2026, 11:26:52 am]
Strange Behaviour at Runt...
by
andrew Bubble
[June 10, 2026, 11:19:45 am]
Can I get the position an...
by
CM630
[June 10, 2026, 11:00:33 am]
WEBP, no DLLs
by
CM630
[June 10, 2026, 08:52:43 am]
Dataset EnableControls/Di...
by
Sharfik
[June 10, 2026, 07:40:21 am]
TVirtualDBTreeEx and upda...
by
Sharfik
[June 10, 2026, 07:36:30 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Text Coloring not working on Win X (Read 1315 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: 13556
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