Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
LAMW: Change jComboEditText Dropdown font color/Background color
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
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Lazarus for Windows on aa...
by
dbannon
[
Today
at 07:02:55 am]
BUG REPORT: Unable to gen...
by
dbannon
[
Today
at 06:29:49 am]
Database standards OR Am ...
by
cdbc
[
Today
at 06:24:05 am]
Offical launch of the 1 B...
by
Gustavo 'Gus' Carreno
[
Today
at 12:50:46 am]
what to do if my target M...
by
Laksen
[
Today
at 12:49:12 am]
For-in loop over constant...
by
ASerge
[
Today
at 12:36:09 am]
Converting a string/index...
by
TRon
[April 18, 2024, 11:56:37 pm]
exclude ALL packages from...
by
PascalDragon
[April 18, 2024, 11:33:29 pm]
Demoscene The Champs Crac...
by
KodeZwerg
[April 18, 2024, 11:29:50 pm]
Poll: Watches and Display...
by
440bx
[April 18, 2024, 10:55:14 pm]
How to: create DLL file f...
by
paule32
[April 18, 2024, 10:23:59 pm]
Have anyone develop UEFI ...
by
PascalDragon
[April 18, 2024, 10:14:15 pm]
The weird Rewrite bug
by
PascalDragon
[April 18, 2024, 09:58:53 pm]
Assign (textfile) not com...
by
PascalDragon
[April 18, 2024, 09:51:50 pm]
Question for people who h...
by
PascalDragon
[April 18, 2024, 09:44:32 pm]
Linux Workspaces -- StayO...
by
AmatCoder
[April 18, 2024, 08:34:20 pm]
I just released a commerc...
by
Seenkao
[April 18, 2024, 07:57:21 pm]
Access violation when re-...
by
TRon
[April 18, 2024, 07:37:31 pm]
[SOLVED] assembler name i...
by
TRon
[April 18, 2024, 07:26:33 pm]
A fairly simple sound sol...
by
KodeZwerg
[April 18, 2024, 07:01:52 pm]
Step-into the field sette...
by
Martin_fr
[April 18, 2024, 06:54:19 pm]
[Fun Fact] PNG and Micros...
by
Ten_Mile_Hike
[April 18, 2024, 06:24:19 pm]
HTTP/2+HTTP/1.1+WebSocket...
by
iLya2IK
[April 18, 2024, 06:14:30 pm]
Improvement of TFPTimerTh...
by
AlexTP
[April 18, 2024, 05:56:38 pm]
Arabic text, problem on L...
by
nouzi
[April 18, 2024, 05:21:27 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: LAMW: Change jComboEditText Dropdown font color/Background color (Read 3176 times)
c4p
Full Member
Posts: 158
LAMW: Change jComboEditText Dropdown font color/Background color
«
on:
September 17, 2017, 02:14:00 pm »
Is there a method to change the font color/background color on jComboEditText component?
Can't find one for it other than Font color/background for the edit box, not the dropdown font color/background color?
Thanks in advance.
«
Last Edit: September 17, 2017, 03:03:13 pm by c4p
»
Logged
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5
wp
Hero Member
Posts: 11916
Re: LAMW: Change ComboEditText Dropdown font color/Background color
«
Reply #1 on:
September 17, 2017, 02:31:35 pm »
You can draw the items using the OwnerDraw mechanism: Set Combobox.Style to csOwnerDrawfixed or csOwnerDrawVariable - in the latter case you also can vary the item height by using OnMeasureItem - and write a handler for the OnDrawItem event, like this:
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
ComboBox1DrawItem
(
Control
:
TWinControl
;
Index
:
Integer
;
ARect
:
TRect
;
State
:
TOwnerDrawState
)
;
begin
with
Control as TCombobox
do
begin
Canvas
.
FillRect
(
ARect
)
;
if
DroppedDown
then
Canvas
.
Font
.
Color
:
=
clRed
;
Canvas
.
TextOut
(
ARect
.
Left
+
2
,
ARect
.
Top
+
2
,
Items
[
Index
]
)
;
end
;
end
;
Logged
c4p
Full Member
Posts: 158
Re: LAMW: Change ComboEditText Dropdown font color/Background color
«
Reply #2 on:
September 17, 2017, 02:46:03 pm »
Will this work on the LAMW jComboEditText component?
«
Last Edit: September 17, 2017, 02:49:27 pm by c4p
»
Logged
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5
wp
Hero Member
Posts: 11916
Re: LAMW: Change jComboEditText Dropdown font color/Background color
«
Reply #3 on:
September 17, 2017, 03:12:45 pm »
Sorry, I did not see the "j". But why don't you try?
Logged
c4p
Full Member
Posts: 158
Re: LAMW: Change jComboEditText Dropdown font color/Background color
«
Reply #4 on:
September 17, 2017, 03:50:43 pm »
Already did, was just checking.
Thanks anyway.
«
Last Edit: September 17, 2017, 03:59:45 pm by c4p
»
Logged
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5
jmpessoa
Hero Member
Posts: 2301
Re: LAMW: Change jComboEditText Dropdown font color/Background color
«
Reply #5 on:
September 19, 2017, 03:06:11 am »
Hi c4p!
About:
Quote
dropdown font color/background color?
I will improve "jComboEditText" ...
Thank you!
Edited: Done!!!!
«
Last Edit: September 19, 2017, 04:46:52 am by jmpessoa
»
Logged
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard
c4p
Full Member
Posts: 158
Re: LAMW: Change jComboEditText Dropdown font color/Background color
«
Reply #6 on:
September 19, 2017, 09:29:31 am »
Working perfect, thank you so much jmpessoa
Logged
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
LAMW: Change jComboEditText Dropdown font color/Background color
TinyPortal
© 2005-2018