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

推荐订阅源

博客园 - 三生石上(FineUI控件)
博客园 - Franky
GbyAI
GbyAI
B
Blog
WordPress大学
WordPress大学
D
Docker
小众软件
小众软件
月光博客
月光博客
博客园 - 【当耐特】
T
The Blog of Author Tim Ferriss
IT之家
IT之家
腾讯CDC
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
H
Help Net Security
M
MIT News - Artificial intelligence
L
LangChain Blog
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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