Converting String to Color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I decided to start a new thread. I have output in xml file format. It looks like this:

<P1JoyUp>
<Top>326</Top>
<Left>54</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>True</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0, GdiVerticalFont=False]</Font>
</P1JoyUp>

I write it out and read it in using a data set. Now when I read it in I need to convert the forecolor and backcolor strings to system.drawing.something. WHere do I need to look for an answer.

Thanks,
John
 
Hi,

Take a look at Color.FromName
http://msdn.microsoft.com/library/d...frlrfsystemdrawingcolorclassfromnametopic.asp


Ken
-----------------

jcrouse said:
I decided to start a new thread. I have output in xml file format. It
looks like this:

<P1JoyUp>
<Top>326</Top>
<Left>54</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>True</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyUp>

I write it out and read it in using a data set. Now when I read it in I
need to convert the forecolor and backcolor strings to
system.drawing.something. WHere do I need to look for an answer.

Thanks,
John
 
Back
Top