Link to home
Start Free TrialLog in
Avatar of boycoder
boycoder

asked on

change colour of combobox items.

Hi how can i change the colour of the combobox for each item?

for the first item which is 0 i want red
for the second i want yellow and the third i want green

Thanks.
Avatar of systan
systan
Flag of Philippines image

Avatar of boycoder
boycoder

ASKER

havnt got time to do that, also i think last time i had a quick look it was about using the color picker, i really just need some simple source for the draw event or something. cheers
ASKER CERTIFIED SOLUTION
Avatar of systan
systan
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thnx but i cant seem to get it to work, what is the state of the combobox? any suggestions what culd be wrong.. It compiles, but no change.
im using flatcombobox, maybe thats the problem as i did the test on a blank app and that works with the default controls.
A
procedure TForm1.FormCreate(Sender: TObject);
begin
 ComboBox1.Items.Add('Item 1');
 ComboBox1.Items.Add('Item 2');
 ComboBox1.Items.Add('Item 3');
 ComboBox1.ItemIndex := 0;

// Sorry, I FORGOT THIS line
 ComboBox1.Style := csOwnerDrawVariable;

end;