如何使用vb.net在Windows应用程序中使用进度条 [英] How to use the progressbar in windows Application using vb.net

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

问题描述

嗨朋友们,我在Windows应用程序中有很多表单。每个人都有一个进度条。我想将进度条应用于所有表单。这里的问题是我不知道表单中的最大记录。如何在表格中完成这个过程。但是这里有一些内部过程需要很长时间。



请任何人帮助我。

Hi Friends, i have a many forms in windows application. each and every having a progress bar. I want to apply the progress bars to all forms.Here problem is I do not know Maximum records in my forms. how can do that process in forms. But here some internal process is going long time.

Please any one help me.

推荐答案

请,阅读本文: ProgressBars [ ^ ]。在那里你可以找到如何使用进度条的信息。
Please, read this article: ProgressBars[^]. There you'll find information how to use progressbars.


Public Class Form1



Dim iCounter As Integer



Private Sub Timer1_Tick(ByVal sender As System.Object,ByVal e As System.EventArgs)处理Timer1.Tick



如果iCounter> ProgressBar1.Maximum然后

退出Sub

结束如果



ProgressBar1.Value = iCounter

iCounter = iCounter + 1

End Sub



Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System。 EventArgs)处理Button1.Click

Timer1.Enabled = True

End Sub



Private Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)处理Button2.Click

Timer1.Enabled = False

End Sub



Private Sub Button3_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)处理Button3.Click

iCounter = 0

ProgressBar1.Value = 0

结束子

结束班
Public Class Form1

Dim iCounter As Integer

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

If iCounter > ProgressBar1.Maximum Then
Exit Sub
End If

ProgressBar1.Value = iCounter
iCounter = iCounter + 1
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
iCounter = 0
ProgressBar1.Value = 0
End Sub
End Class


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

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