Ejemplo n.º 1
0
        private void CompanySelectForm_Load(object sender, EventArgs e)
        {
            CompanyClass cn = new CompanyClass();

            DataTable dt = cn.getAllCompany();

            foreach (DataRow d in dt.Rows)
            {
                Button bt = new Button();
                bt.Tag       = d["com_id"];
                bt.BackColor = Color.DodgerBlue; //Color.FromArgb(0, 0, 180, 255);
                bt.ForeColor = Color.White;
                bt.Font      = new Font("Tahoma", 10, FontStyle.Bold);
                bt.Cursor    = Cursors.Hand;
                bt.FlatStyle = FlatStyle.Flat;
                bt.Width     = 250;
                bt.Padding   = new Padding(5, 5, 5, 5);
                bt.AutoSize  = true;
                bt.Text      = d["com_name"].ToString();
                bt.Click    += Bt_Click;
                flowLayoutPanel1.Controls.Add(bt);
            }
        }