declaring objects const?

  • Thread starter Thread starter Karl Hungus
  • Start date Start date
K

Karl Hungus

I get an error with the line:

private const Color textColorOff = Color.FromArgb(153,153,153);

Is there a way to declare this value constant?
 
Hi Karl,

You could declare it readonly or static readonly

private static readonly Color textColorOff = Color.FromArgb(153,153,153);


Happy coding!
Morten Wennevik [C# MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top