C#和Windows应用程序中的进度条 [英] Progess bar in C# and Windows application

查看:125
本文介绍了C#和Windows应用程序中的进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在尝试在Windows应用程序中使用C#实现从Excel工作表到数据库的数据传输的进度条.
我以前从未从事过此类工作,因此需要您提供宝贵的意见来实现这一目标.
问候,
Ramakrishna

HI All,
I am trying to implement progress bar for data transfer from an excel sheet to database using C# in windows application.
i have never worked on this kind earlier and need your valuable inputs on how to implement this.
Regards,
Ramakrishna

推荐答案

一个非常简单的启动示例 ^ ].
A very simple startup example here[^].


这只是一个非常简单的控件,但功能也很强大,

只需假设您的Excelsheet 具有2000行,并且您要将这些行传输到DB.

只需将MinimumValue 设置为0并将MaximumValue 设置为2000,您就可以在excel中获取行数之后将其设置为运行时.

然后只需设置StepSize = 1,

在每行插入之后,只需使用PerformStep 方法,这将使ProgressBar的值增加,最后将ProgressBarValue 属性再次设置为0,以将其绘制为初始状态,

您可能有 THIS [
It is just very simple control yet powerful too,

Simply assume that your Excelsheet having 2000 rows and you want to transfer these rows to DB.

Just set MinimumValue to 0 and MaximumValue to 2000 you can set this to runtime also after you get rows count in excel.

and then just set StepSize = 1,

after each row insertion just use PerformStep method which will make the ProgressBar value increasing and finally set Value Properties of ProgressBar to again 0 to draw it in initial state,

You could have THIS[^] article to be useful.

Please vote and Accept Answer if it Helped.


这篇关于C#和Windows应用程序中的进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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