Hi,,
I want to set windows form background color through variable like bellow..
adpt = new SqlDataAdapter("select bgcolor from colorschem",conn);
dt = new DataTable();
adpt.Fill(dt);
if (dt.Rows.Count > 0)
{
string a;
foreach (DataRow row in dt.Rows)
{
a = (row[0].ToString());
}
this.backcolor=color.red;
//here i want to assign the variable value just like a variable...
so how it is possible...?
}
any body help...
Loading
VulpesPosted May 30, 2011, 8:07 AM
Kanhialal kkPosted May 31, 2011, 12:01 AM
Kanhialal kkPosted May 30, 2011, 7:42 AM
while database column like(BGCOLOR(varchar)200);
ff6f97bf
VulpesPosted May 30, 2011, 5:47 AM
Can you tell me exactly what's being stored in the database because it can't be something simple such as "Red" or "Blue".
Kanhialal kkPosted May 30, 2011, 12:17 AM
Control does not support transparent background colors.
VulpesPosted May 28, 2011, 7:44 AM
Try this instead:
this.BackColor = Color.FromName(a);
Kanhialal kkPosted May 28, 2011, 7:27 AM
Argument Exception was unhandled...
Type provided must be an Enum.
Parameter name: enumType
VulpesPosted May 28, 2011, 7:16 AM
this.BackColor = (System.Drawing.Color) Enum.Parse(typeof(System.Drawing.Color), a);
Kanhialal kkPosted May 28, 2011, 6:50 AM
VulpesPosted May 28, 2011, 6:34 AM