首页 > 其他 > 详细

this.invoke(new Action

时间:2020-11-04 09:58:23      阅读:216      评论:0      收藏:0      [点我收藏+]
        private void CheckA()
        {
            System.Threading.ThreadPool.QueueUserWorkItem(t => {
                ShowInfo("检测开始.....");
                System.Threading.Thread.Sleep(3000);
                ShowInfo("暂停3秒结束.....");
                System.Threading.Thread.Sleep(2000);
                ShowInfo("暂停2秒结束.....");
                System.Threading.Thread.Sleep(1000);
                ShowInfo("检测结束");
            });
                       
        }
        private void ShowInfo(string Info)
        {
            listView1.Invoke(new Action(() =>
            {
                listView1.Columns[0].Width = listView1.ClientSize.Width;
                listView1.Items.Insert(0, new ListViewItem(Info));
            }));            
        }  



this.invoke(new Action

原文:https://www.cnblogs.com/xihong2014/p/13924210.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!