码迷,mamicode.com
首页 > Windows程序 > 详细

Winform与WPF异步修改控件属性

时间:2017-03-13 19:04:12      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:info   winform   invoke   win   his   isp   required   cti   content   

Winform方式:
    if (this.InvokeRequired)
            {
                this.Invoke(
                    new Action (
                        delegate(Form form1)
                        {
                            lblTip.Content = msg;
                        })
                    , this
                );
            }
WPF方式:
            this.Dispatcher.BeginInvoke((Action)delegate()
            {
                lblTip.Content = msg;
            });

Winform与WPF异步修改控件属性

标签:info   winform   invoke   win   his   isp   required   cti   content   

原文地址:http://www.cnblogs.com/Catherine2011/p/6544288.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!