Solved

Error with colors

Posted on 2002-05-01
5
419 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 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

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

11 Experts available now in Live!

Get 1:1 Help Now