WinForm progressbar 文字显示问题?

朗烽 2017-03-23 02:47:27
在WinForm 中使用progressbar显示百分比,只会在赋值那一刻有显示,如果停顿不继续赋值,窗体移动或鼠标点击就会消失
有什么办法可以一直显示进度条的文字不消失??

string str = "15%"
Font font = new Font("微软雅黑", (float)20, FontStyle.Regular);
PointF pt = new PointF(progress.Width / 2 - 30, progress.Height / 2 - 20);

progressbar.CreateGraphics().DrawString(str, font, Brushes.Red, pt);

这是我在进度条上显示文字的代码
...全文
783 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xdashewan 2017-03-23
  • 打赏
  • 举报
回复
参考http://lzy3169421.blog.163.com/blog/static/11354527720097710196795/

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧