Solved

Setting colours on the fly

Posted on 2004-04-06
2
163 Views
Last Modified: 2010-04-05

I have a custom control grid with various records in it, depending on certain values the row attributes, such as BG colour, font colour etc are changed.

This works fine by using the draw events of the control

ie

AFont.Color := clRed;

However I want to enable the users to set these colours themselves, so I have another table with values like this

$CC0099
$CCFFCC
....

The I try to set the colour in the same draw event like this:

AFont.Color := TColor(QueryColourSel.AsString);

but this doesn't work, the reason I'm not storing cl colour values in the table is because I want additional colours that are not standard.

Any suggestions on why this doesn't work, no errors are produced, but the colour doesn't change.

Thanks
0
Comment
Question by:dealclickcouk
2 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 125 total points
ID: 10765256
It should work
  AFont.Color := TColor(StrToInt(QueryColourSel.AsString));
0
 

Author Comment

by:dealclickcouk
ID: 10765424

god I'm so stupid, why didn't I think of that!!

thanks for the quick response...
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question