Color

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

Hello, It must just be a bad day for me...Maybe I should just go home...

The compiler highlights this line... using System.Drawing...there is such a
namespace, why can't I import it?

If I what to format a string and at the same time assign it a particular
color, what is the best way to do this?

string myField = string.Format("{0:g}", MyValue);

I see no property on the string which will allow me to assign it color
(shouldn't have a Font property?)
 
The "using" statement does not import anything. It only allows you to use
short cut declarations in your code. What you need to do is to reference
"System.Drawing.dll". Without this reference, your compiler will not
recoginize "using System.Drawing;"

Color is a function of output. Strings do not store any output infomation
(font, color, sound, etc.). You can, of course, store tagged text that can
be used by an output device (HTML text, RTF text). There is nothing stopping
you from creating your own class that stores a string and a color.

Mike P
 
Back
Top