如何在加载另一个表单时加载进度条? [英] How to load a progressbar while loading another form?

查看:51
本文介绍了如何在加载另一个表单时加载进度条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在加载另一个表单时显示进度条.

要加载的表单要花一些时间,因为它正在将数据从第一个数据库的一个表加载到另一个数据库的另一个表.
因此,要让用户知道当前正在完成工作,我需要显示一个进度条.

需要一点帮助.

I need to show a progress bar while loading another form.

The form to be loaded is taking time because it is loading data from one table of first database to the another table of another database.
So, to let the user know that the work is currently being done, i need a progress bar to show.

A little bit of help needed.
Thanks, in advance.

推荐答案

您需要将数据加载代码移至后台线程,以便释放UI线程来更新进度条控件.使用 BackgroundWorker [ ^ ]简化此操作.
You need to move your data loading code to a background thread so this frees up the UI thread to update the progress bar control. Look into using a BackgroundWorker[^] to simplify this.


这篇关于如何在加载另一个表单时加载进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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