On Mon, 29 Sep 2003 12:47:04 +0530, "Rakesh"
<ra*****@asianetindia.com> wrote:
string fillColor = "Salmon";
ColorConverter colorConverter = new ColorConverter();
textBox1.BackColor = (Color) colorConverter.ConvertFromString(fillColor);
*********************************************
The code below produced the error:
Aquamarine is not a valid value for Int32
Colors like Aquamarine are the ones I want to diaplay.
How should I change the code?
Many thanks.
Patrick
*********************************************
private void Colors_Load(object sender, System.EventArgs e)
{
using (StreamReader sr = new StreamReader(@"Colors.txt"))
for(int i = 0; i<Controls.Count; i++)
{
Control mine = Controls[i];
if (mine is TextBox)
{
string fillColor = sr.ReadLine();/////// error line /////////
ColorConverter colorConverter = new ColorConverter();
mine.BackColor = (Color)colorConverter.ConvertFromString(fillColor) ;
}
}
}