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
add new targets to make
by
Key-Real
[
Today
at 06:04:22 pm]
Unlocking Files
by
KodeZwerg
[
Today
at 06:03:08 pm]
[SOLVED] trunk bug for mi...
by
Key-Real
[
Today
at 05:56:32 pm]
Demo Scene Bitmap Font Sc...
by
Gigatron
[
Today
at 05:56:27 pm]
Compile/Convert Delphi pr...
by
Martin_fr
[
Today
at 05:43:11 pm]
Generics - correct syntax
by
Thaddy
[
Today
at 05:40:59 pm]
Parameter passing odditie...
by
Thaddy
[
Today
at 05:35:41 pm]
Lazarus for Windows on aa...
by
msintle
[
Today
at 05:32:42 pm]
InstallAware Using Lazaru...
by
msintle
[
Today
at 05:26:36 pm]
Xcode Command Line Tools ...
by
Joseph
[
Today
at 05:16:39 pm]
Offical launch of the 1 B...
by
Hartmut
[
Today
at 04:49:29 pm]
what to do if my target M...
by
nickysn
[
Today
at 04:16:02 pm]
compiler error in unit
by
paule32
[
Today
at 03:49:50 pm]
how to tweek fpmake to co...
by
Key-Real
[
Today
at 02:33:27 pm]
Can function be used for ...
by
VisualLab
[
Today
at 02:15:30 pm]
Multithreading - synchron...
by
mika
[
Today
at 01:48:51 pm]
A fairly simple sound sol...
by
KodeZwerg
[
Today
at 01:48:26 pm]
May be useful to somebody
by
KodeZwerg
[
Today
at 12:38:22 pm]
match automatic highlight...
by
Чебурашка
[
Today
at 11:35:14 am]
Tchart with dual numbers ...
by
wp
[
Today
at 10:48:18 am]
Debugger crashes with App...
by
Martin_fr
[
Today
at 09:29:46 am]
Copyrights Q
by
BrassGear
[
Today
at 09:13:14 am]
[SOLVED] how to build the...
by
Key-Real
[
Today
at 09:12:33 am]
Quirky windows
by
tetrastes
[
Today
at 08:59:06 am]
How can I draw a rectangl...
by
Handoko
[
Today
at 07:30:55 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: LAMW: Change jComboEditText Dropdown font color/Background color (Read 3197 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: 11923
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: 11923
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: 2302
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