Hi
Try this
string ColorName = ...;
System.Drawing.Color MyColor;
if (ColorName[0]=='#')
MyColor = System.Drawing.Color.FromArgb(int.Parse(ColorName. Substring(1,2),System.Globalization.NumberStyles.H exNumber),nt.Parse(ColorName.Substring(3,2),System .Globalization.NumberStyles.HexNumber),int.Parse(C olorName.Substring(5,2),System.Globalization.Numbe rStyles.HexNumber));
else
MyColor = System.Drawing.Color.FromName(ColorName);
"Mevar81" <to*****@hotmail.com> wrote in message news:02****************************@phx.gbl...
Anyone know if is it possible to create dinamically a
struct?For example I want to set the color of a button
while at runtime, and to set it's ForeColor property I
need to read a Xml file where I store the property value
of the button.The color is a System.drawing.Color
struct.Anyone know how to create a struct from a string
that rappresent the struct (for example a string like
Color.AliceBlue).Thanks to everybody