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

推荐订阅源

P
Proofpoint News Feed
博客园_首页
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Engineering at Meta
Engineering at Meta
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
G
Google Developers Blog
Last Week in AI
Last Week in AI

博客园 - See Me Fly

[MVC] Code First中Migration的问题 [MVC]开篇 搭建小型邮件服务器 Visual Studio中添加Service异常 IIS7 IIS8上面运行 ASP 画圆滑的曲线连接地图上面的点 [IIS] 不能加载类型System.ServiceModel.Activation.HttpModule [DICOM] Download ClearCanvas Source Code [DICOM] 开篇 研究SplendidCRM UnauthorizedAccessException trying to delete a file Crystal Report 2011连接SQL Server 2008失败 Xcode: 给项目添加framework DC中用户的同步问题 用VNC连接Mac OS Xcode访问SVN服务器 Window 7访问共享目录问题 JIRA配置SSL Failed to install MSXML6 when installing SQL Server 2005 - See Me Fly
[转]C#WinForm - 立即更新静态文本Label
See Me Fly · 2012-08-14 · via 博客园 - See Me Fly

C#WinForm - 立即更新静态文本Label

(Update the Label/TextBox dynamically in your process in WinForm with C#) 

【问题】

有时候,想在状态栏显示“正在转换数据,请稍后……”之类的提示,但是给Label赋值后,Label的显示文本并没有改变,而是等操作(例如转换数据)完成了之后才变化为“正在……”

那么怎么让静态文本立即显示更新的文本内容呢?

【解决】

其实很简单,只要使用Label.Refresh();函数强制Label控件刷新显示即可:

Label1.Text = "正在转换数据,请稍后……";
Lable1.Refresh();

经本人运行测试,效果符合要求,问题解决。

注:次方法对ListBox等多种控件都有效 

转载请注明出处hi.baidu.com/公子迅,谢谢大家的支持 ^_^

posted @ 2012-08-14 22:22  See Me Fly  阅读(8093)  评论(1)    收藏  举报