Trong winform, phải chạy hết code thì giao diện mới hiển thi. Vậy tôi muốn hiển thị giao diện sau mỗi hoạt động nào đó thì sao? Ở đoạn code dưới, tôi muốn thấy từng button được add vào form sau khi click vào button.
private void button1_Click(object sender, EventArgs e)
{
for(int i=0;i<10;i++)
{
Button bt = new Button
{
Text = i.ToString(),
Size = new Size(50, 50),
Location = new Point(0, 0)
};
this.Controls.Add(bt);
System.Threading.Thread.Sleep(500);
}
}