Button newPanelcategory = new Button(); newPanelcategory.Name = dt.Rows[i]["table_id"].ToString(); newPanelcategory.Text = dt.Rows[i]["table_id"].ToString(); newPanelcategory.Location = System.Drawing.Point.Add(new Point(0, 4 + i * 55), new Size(50, 50)); newPanelcategory.Height = 50; newPanelcategory.Width = 75; newPanelcategory.FlatStyle = FlatStyle.Flat; newPanelcategory.Font = new Font("Times New Roman", 10, FontStyle.Bold); this.Controls.Add(newPanelcategory); flowLayoutPanel1.Controls.Add(newPanelcategory); newPanelcategory.BackColor = Color.Red; newPanelcategory.ForeColor = Color.White; newPanelcategory.Click += new EventHandler(newPanelcategory_Click); flowLayoutPanel1.AutoScroll = true; DataTable dtms = blod.getallorder(); for (int ia = 0; ia < dtms.Rows.Count; ia++) { if ((dtms.Rows[ia]["active"]).ToString() == "yes") { newPanelcategory.BackColor =Color.Blue; } else { newPanelcategory.BackColor = Color.Red; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)