Kanhialal kk

Kanhialal kk

  • NA
  • 234
  • 338.7k

how to set background color of a windows form from a variable?

May 28 2011 6:28 AM
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...

Answers (10)