如何在执行打印,扫描等长时间运行的作业时,如何保持更新的标签控件显示当前时间表? [英] How can I keep updated lable control showing current time table while doing a long running job like printing, Scanning etc?

查看:85
本文介绍了如何在执行打印,扫描等长时间运行的作业时,如何保持更新的标签控件显示当前时间表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我只扫描文件并将其保存在数据库中。

我在状态栏中显示标签控件,显示当前时间,当我开始扫描时,扫描对话框显示进度条。但同时扫描状态栏上的当前时间卡住,为什么???

我不知道如何更新标签控件一个单独的线程???

我需要帮助: - (

解决方案

了解背景工作者这将满足您的需求:



初学者的BackgroundWorker课程样本 [ ^ ]

I'm working on a project in which I just scan files and save them in database.
I've a label control in the status bar showing current time,when I start scanning ,a scanning dialog box with a progress bar shows up.But at the same time while scanning current time on the status bar gets stuck,Why???
I don't know how to keep label control updated in a separate thread ???
I need help :-(

解决方案

Read about backgroundworker this will suffice what you want:

BackgroundWorker Class Sample for Beginners[^]


这篇关于如何在执行打印,扫描等长时间运行的作业时,如何保持更新的标签控件显示当前时间表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆