G
Guest
I am trying to take the background color of the form from a user's
preferences file stored in xml file.
I tried:
while(XmlRdr.Read())
{
//check the node type and look for the element type
//whose Name property is equal to bg_color.
if (XmlRdr.NodeType==XmlNodeType.Element&&XmlRdr.Name=="bg_color")
{
Form1 frmMain = new Form1();
frmMain.BackColor = XmlRdr.ReadString();
frmMain.ShowDialog();
}
}
and it replies me the error that is in the subject: Cannot implicitly
convert type 'string' to 'System.Drawing.Color'. Can someone please suggest
solution?
Thanks a lot
preferences file stored in xml file.
I tried:
while(XmlRdr.Read())
{
//check the node type and look for the element type
//whose Name property is equal to bg_color.
if (XmlRdr.NodeType==XmlNodeType.Element&&XmlRdr.Name=="bg_color")
{
Form1 frmMain = new Form1();
frmMain.BackColor = XmlRdr.ReadString();
frmMain.ShowDialog();
}
}
and it replies me the error that is in the subject: Cannot implicitly
convert type 'string' to 'System.Drawing.Color'. Can someone please suggest
solution?
Thanks a lot