示例#1
0
        public void displayStalls()
        {
            stallListflowLayoutPanel.Controls.Clear();
            int sp = 3;
            int ep = 3;

            try
            {
                _sc.getStalls();
                foreach (DataRow row in _sc.QueryExe().Rows)
                {
                    Button b = new Button();
                    b.Name      = row["stall_number"].ToString();
                    b.Text      = row["stall_number"].ToString();
                    b.Location  = new Point(sp, ep);
                    b.Height    = 40;
                    b.Width     = 155;
                    b.FlatStyle = FlatStyle.Popup;
                    b.BackColor = SystemColors.Control;
                    b.TextAlign = ContentAlignment.MiddleCenter;
                    stallListflowLayoutPanel.Controls.Add(b);
                    ep      += 10;
                    b.Click += delegate(object sender, EventArgs evt) { btn_Click(sender, evt, row); };
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
 private void displayStalls()
 {
     _sc.getStalls();
     stallNumberCbx.DataSource    = _sc.QueryExe();
     stallNumberCbx.ValueMember   = "stall_id";
     stallNumberCbx.DisplayMember = "stall_number";
     stallNumberCbx.SelectedIndex = -1;
 }