C# Winfrom 窗体上动态生成控件慢处理

2021-01-27 15:13

阅读:721

标签:new   pre   vat   nbsp   winfrom   style   click   ESS   add   

处理方式:布局挂起

panelContent.SuspendLayout();
panelContent.ResumeLayout();
 private void button1_Click(object sender, EventArgs e)
        {
            panelContent.SuspendLayout();
            this.panelContent.Controls.Clear();
            string aa = DateTime.Now.ToString();
            int k = 1;
            for (int j = 0; j 200; j++)
            {
                Add(new QueueButton(), k, this.panelContent, 16, "18.00", "19.00", "Pm");
                k++;
            }
            panelContent.ResumeLayout();
            string bb = DateTime.Now.ToString();

            MessageBox.Show(aa+"\r\n"+bb);
    
        }

 

C# Winfrom 窗体上动态生成控件慢处理

标签:new   pre   vat   nbsp   winfrom   style   click   ESS   add   

原文地址:https://www.cnblogs.com/YYkun/p/11929152.html


评论


亲,登录后才可以留言!