Hey
I just want to build a combo box with different items having different colors
for example different values with colors blue, orange, red
Thanks for any example in Delphi 7
TnxComboBox - items with different colors
Started by PCBleu, Jul 28 2014 05:00 PM
5 replies to this topic
#1
Posted 28 July 2014 - 05:00 PM
#2
Posted 29 July 2014 - 04:25 PM
Hey - I tried onDrawItem event, but it seems to be not available for NxComboBox controls !!!
with this code :
with this code :
procedure TForm1.NxComboBox1DrawItem(Sender: TObject; Index: Integer; Rect: TRect; State: TNxItemState); begin if index mod 2<>1 then begin nxComboBox1.canvas.brush.color:=clwhite; nxComboBox1.canvas.fillrect(rect); end else begin nxComboBox1.canvas.brush.color:=$00F4F3EE; nxComboBox1.canvas.fillrect(rect); end; nxComboBox1.canvas.textout(rect.left+30,rect.top+2,ComboBox1.items[index]); end;
#3
Posted 30 July 2014 - 08:50 PM
Hi,
Please tell me do you also have set DrawingOptions property of ComboBox?
Please tell me do you also have set DrawingOptions property of ComboBox?
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#4
Posted 30 July 2014 - 10:34 PM
Hey
with any option of DrawingOptions, I do not obtain what I expect
Thanks for your help
Here is an example of what I want to obtain
with any option of DrawingOptions, I do not obtain what I expect
Thanks for your help
Here is an example of what I want to obtain
#5
Posted 31 July 2014 - 01:15 PM
Hi,
I forgot to mention, that you need to access to the Canvas of PopupControl, not combobox itself:
I hope that this helps.
I forgot to mention, that you need to access to the Canvas of PopupControl, not combobox itself:
with NxComboBox1.PopupControl.Canvas do begin Brush.Color := clRed; FillRect(Rect); end;
I hope that this helps.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#6
Posted 31 July 2014 - 03:31 PM
Thanks a lot - That helps
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users