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

推荐订阅源

美团技术团队
N
Netflix TechBlog - Medium
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
V
Visual Studio Blog
H
Help Net Security
Engineering at Meta
Engineering at Meta
Hugging Face - Blog
Hugging Face - Blog
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
博客园 - 【当耐特】
B
Blog
Stack Overflow Blog
Stack Overflow Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
博客园 - 司徒正美
博客园 - 叶小钗
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - 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;
}