?
Solved

Error with colors

Posted on 2002-05-01
5
Medium Priority
?
437 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
5 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
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…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

862 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