int i = 1; foreach (TabPage tp in tabControl1.TabPages) { ObjectQuery<tblproduct> listProduct = new ObjectQuery<tblproduct>("SELECT VALUE P FROM TblProducts AS P WHERE P.ProductType = " + i.ToString(), afNewObject); FlowLayoutPanel flp = new FlowLayoutPanel(); flp.Dock = DockStyle.Fill; foreach (TblProduct tprod in listProduct) { Button b = new Button(); b.Size = new Size(100, 100); b.Text = tprod.Description; b.BackgroundImage = tprod.Image; // error line b.Tag = tprod; b.Click += new EventHandler(UpdateProductList); flp.Controls.Add(b); } tp.Controls.Add(flp); i++;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)