Winform与WPF异步修改控件属性

Posted Yanina2011

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Winform与WPF异步修改控件属性相关的知识,希望对你有一定的参考价值。

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异步修改控件属性的主要内容,如果未能解决你的问题,请参考以下文章