Solved

Error with colors

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 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