惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
T
Tailwind CSS Blog
博客园_首页
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
J
Java Code Geeks
量子位
D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
C
Check Point Blog
V
Visual Studio Blog
H
Help Net Security
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta

博客园 - IamV

ADO.NET Entity Framework: 由 Entity Object 執行 SQL 指令 Expression<Func<int, bool>>与<Func<int, bool> search something from db How to Embed Silverlight Content in HTML [转]python文件操作/打开/删除文件/压缩文件 Flash与3D编程探秘 - 文章目录 silverlight RenderTransform 后台动画设置 2104 Couldn't download the silverlight application Cannot connect to external websites - WebClient - IamV [Desklighter]在桌面上运行你的Silverlight文件 [转]Silverlight 2.0 正式版跨域提交数据 Application.DoEvent() 转:C#线程调用带参数的方法 [转]深入了解字符集和编码 Office SharePoint Server Search与Windows SharePoint Services Search 调用WCF返回Josn的两种方式 asp.net Excel_MyTest SharePoint-Server Farm Configuration Not Complete Using JSON with ASP.NET 3.5
.NET下多线程中设置按钮的文本 - IamV - 博客园
IamV · 2008-11-26 · via 博客园 - IamV

Windows:
delegate void DelegateSetValue(Button btn, string value);
private void TheTime()
{
    DelegateSetValue d = new DelegateSetValue(SetValue);
    btnSearch.Invoke(d, btnSearch, "忙**");
    Thread.Sleep(1000);
    btnSearch.Invoke(d, btnSearch, "搜索");
}
private void SetValue(Button btn, string value)
{
    btn.Text = value;
}

WPF:
private delegate void DelegateSetValue(Button btn, string value);
private void TheTime()
{
    Delegate d = Delegate.CreateDelegate(typeof(DelegateSetValue),this,"SetValue");
    btnSearch.Dispatcher.Invoke(DispatcherPriority.Normal, d, btnSearch, "忙..");
    Thread.Sleep(1000);
    btnSearch.Dispatcher.Invoke(DispatcherPriority.Normal, d, btnSearch, "搜索");
}
private void SetValue(Button btn, string value)
{
    btn.Content = value;
}

Silverlight:
delegate void DelegateSetValue(Button btn, string value);
private void TheTime()
{
    DelegateSetValue d = new DelegateSetValue(SetValue);
    btnSearch.Dispatcher.BeginInvoke(d, btnSearch, "忙--");
    Thread.Sleep(1000);
    btnSearch.Dispatcher.BeginInvoke(d, btnSearch, "搜索");
}
private void SetValue(Button btn, string value)
{
    btn.Content = value;
}