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
[solved] how to get class...
by
Joanna
[
Today
at 03:53:05 pm]
Who is Indy mattias?
by
jollytall
[
Today
at 03:34:56 pm]
I just released a commerc...
by
BrassGear
[
Today
at 03:17:28 pm]
Does anyone know why thes...
by
Laksen
[
Today
at 03:04:14 pm]
Database standards OR Am ...
by
gidesa
[
Today
at 02:37:56 pm]
How to: create DLL file f...
by
TRon
[
Today
at 02:26:53 pm]
A fairly simple sound sol...
by
paweld
[
Today
at 01:46:11 pm]
Demoscene The Champs Crac...
by
KodeZwerg
[
Today
at 01:45:18 pm]
Access violation when ope...
by
Чебурашка
[
Today
at 12:27:34 pm]
Step-into the field sette...
by
Martin_fr
[
Today
at 11:31:48 am]
Access violation when re-...
by
Chris Osborne
[
Today
at 11:31:25 am]
AI, NLP and CAI: Text Gen...
by
Dzandaa
[
Today
at 11:03:26 am]
dwindows for Android
by
PierceNg
[
Today
at 10:54:44 am]
create system unit from s...
by
Laksen
[
Today
at 10:53:57 am]
[Solved] Find child contr...
by
Joanna
[
Today
at 09:53:43 am]
FpDebug unexpected Assemb...
by
Marc
[
Today
at 08:46:38 am]
Offical launch of the 1 B...
by
Handoko
[
Today
at 07:59:07 am]
Big Numbers Math
by
iLya2IK
[
Today
at 07:13:20 am]
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]
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]
Poll: Watches and Display...
by
440bx
[April 18, 2024, 10:55:14 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: LAMW: Change jComboEditText Dropdown font color/Background color (Read 3177 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