Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Setting colours on the fly

Posted on 2004-04-06
2
Medium Priority
?
170 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

885 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