10
Reply

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

Kanhialal kk

Kanhialal kk

May 28 2011 6:28 AM
3.4k
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)