Solved

Setting colours on the fly

Posted on 2004-04-06
2
160 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
Comment Utility
It should work
  AFont.Color := TColor(StrToInt(QueryColourSel.AsString));
0
 

Author Comment

by:dealclickcouk
Comment Utility

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

thanks for the quick response...
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now