在winform中同步 [英] synchronous in winform

查看:92
本文介绍了在winform中同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有两种形式,分别是Frm1和Frm2.在Frm1中,我将显示Frm2.数据已加载到Frm2.所以我想在Frm2中的数据完全加载时显示一个等待屏幕或进度条.数据完全加载后,等待屏幕将关闭.
请帮我完成!

Hi all,
I have two forms as Frm1 and Frm2. In Frm1 I will show Frm2. Data is loaded into Frm2. So I want show a waiting screen or progress bar while data in Frm2 is loaded completely. The waiting screen will close after data was loaded completely.
Pls help me done!

推荐答案


在执行某些任务时有效显示和更新进度栏所需的内容可以在任何给定的时间告诉您:

1)到目前为止,您处理了多少个
2)要处理多少?


因此,对于数据库行,首先要获取必须进入文本文件的所有行的计数,然后循环遍历每一行,并使用以下公式在每次循环迭代中更新进度条的值:

[number of rows processed until now] / [number of rows to be processed] * 100

希望对您有帮助
Hi,
What you need to effectively display and update a progress bar while doing some task is be able to tell at any given time:

1) how much have you processed until now
2) how much is it to be processed


So in the case of database rows, first start by getting a count of all the rows you have to get to the text file, then loop through each of them and update the value of the progress bar in each loop iteration by using the formula:

[number of rows processed until now] / [number of rows to be processed] * 100

I hope this helps


这篇关于在winform中同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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