0

The following codes creates dynamic codes which the numbers of control varies from database.

        FlowLayoutPanel flowlayout = new FlowLayoutPanel();
        flowlayout.Dock = DockStyle.Fill;
        flowlayout.AutoScroll = true;

        while (reader.Read())
        {  
            Button button = new Button();
            button.Size = new Size(500, 200);
            button.Name = reader["fname"].ToString();
            button.Text = reader["userID"].ToString();
            button.BackColor = Color.Black;
            button.ForeColor = Color.White;
            button.Dock = DockStyle.Top;
            flowlayout.Controls.Add(button);

        }
        panel1.Controls.Add(flowlayout);

Then I want to add this control into a dynamic Panel control which created during runtime.

Luis
  • 13
  • 6
  • 1
    your posted code its working, so what is your issue? – Jeet Bhatt Sep 03 '13 at 11:24
  • the codes above working fine, but that's only for one control (button). The idea is I want that control inside of a dynamic control. During runtime two controls should run dynamically. – Luis Sep 04 '13 at 01:58

0 Answers0