Solved

Setting colours on the fly

Posted on 2004-04-06
2
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month5 days, 21 hours left to enroll

626 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