Solved

Error with colors

Posted on 2002-05-01
5
425 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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 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