Solved

Error with colors

Posted on 2002-05-01
5
424 Views
Last Modified: 2010-05-18
Hi

Im useing Delphi 6 Ent with service pack 2.

Whenever I have, for example panel.color := clPaleBlue or any color that is at the bottom of the list, I get an error.

EReadError Error reading Panel.color 'invalid property value'

I have tried changing the desktop settings on my pc but it doesnt help.

Whats wrong?
Thanks
Barry.
0
Comment
Question by:BRowley
[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
5 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 6982854
hi,
my d6 doesnt have this color but it works ok if i declare it in the unit :

const
  clMoneyGreen =  TColor($C0DCC0);
  clSkyBlue =     TColor($F0CAA6);
  clCream =       TColor($F0FBFF);
  clMediumGray =  TColor($A4A0A0);
  clOrange =      TColor($33CCFF);
  clBlueGreen =   TColor($CCCC00);
  clPaleGreen =   TColor($CCFFCC);
  clPumpkin =     TColor($0099FF);
  clPurple =      TColor($CC0099);
  clLtPurple =    TColor($FFCCCC);
  clLtBlue =      TColor($FFCC99);
  clPaleBlue =    TColor($FFFFCC);
  clBurntSienna = TColor($000088);
  clPaleYellow =  TColor($CCFFFF);
  clBrown =       TColor($006699);
  clBrick =       TColor($003399);
  clNavalBlue =   TColor($CC9933);
  clDkBlue =      TColor($770000);
  clSeaFoam =     TColor($CCFF00);
  clKhaki =       TColor($669999);
  clDkGreen =     TColor($005500);
  clLtOrange =    TColor($99CCFF);
  clDkTeal =      TColor($999933);
  clDkOrange =    TColor($0099CC);
  clOliveGreen =  TColor($009966);
  clRedBaron =    TColor($0033FF);
  clDkRose =      TColor($9966FF);
  clYellowGreen = TColor($00FFCC);
  clLtViolet =    TColor($FFCCFF);
  clViolet =      TColor($FF33FF);
  clDkViolet =    TColor($993399);
  clLtCyan =      TColor($FFFF99);
  clPaleRed =     TColor($CCCCFF);
  clStone =       TColor($009393DD);
  clLtGreen =     TColor($00A9DD93);
begin
panel1.color := clPaleBlue;
end;


i added the extras as their not standard colors (from the graphics unit) you could add them to a new seperate unit if you want.

Regards Barry
0
 
LVL 3

Expert Comment

by:tongalite
ID: 6982878
Hi,

I had the same trouble.
I discovered something very simple and overlooked by Dummies like me :)
Instead of scrolling down the Color properties list in Obj.Insp. I just double clicked the list box to bring up the colordialog box. Selecting a color from the box adds the color value in the listbox. I just copy and paste the value if it needs to be manually coded.

Good luck
tongalite :-)
0
 
LVL 3

Expert Comment

by:tongalite
ID: 6982898
Oops! forgot the example

procedure TForm1.Button1Click(Sender: TObject);
begin
Panel1.color:=$00C6D6AB;
//a random click on the colordialogbox, palish green:)
end;

end.


T.
0
 
LVL 1

Expert Comment

by:piscean
ID: 6983060
Are you receiving the error during design-time or run-time? Your problem seem inconsistent...
If you assigned clPaleBlue to Panel.Color (in code) using the ":=" operator, Delphi will notify you of the Type Error while compiling and will not raise an exeption, just a compile error. And yet you are saying that the Panel object raised an EReadError which should be displayed during run-time or when assigning value in the Object Inspector...
0
 

Author Comment

by:BRowley
ID: 6983438
Thanks. i was slowly pulling my hair out :)

inthe, top thanks just the answer, it just makes me wonder why the object inspector lists those colors ..

tongalite, thanks didnt know that trick ive posted some points for you too.

piscean, thanks for the comment.

Regards
B.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

737 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