首页 > 学院 > 开发设计 > 正文

VB 中添加进度条

2019-11-06 06:18:32
字体:
来源:转载
供稿:网友

加载时如果没有进度条会给人舒服的感觉,以下是进度条的代码,在加载函数前StartPRogressBar(),执行完之后EndProgressBar()

#Region "进度条" '''==================进度条Begin======================================================================== Private ProgressForSwitchFormT1 As ProgressForSwitchForm Private ThreadT2 As Thread Private Sub ShowProgressForSwitchForm(ByVal ProgressFormT1 As ProgressForSwitchForm) application.Run(ProgressFormT1) End Sub Private Sub EndProgressForm(ByVal ProgressFormT1 As ProgressForSwitchForm) Try ProgressFormT1.Close() Catch ex As Exception End Try End Sub ' 开始进度条 Public Sub StartProgressBar() ProgressForSwitchFormT1 = New ProgressForSwitchForm() ThreadT2 = New Threading.Thread(AddressOf ShowProgressForSwitchForm) ThreadT2.Start(ProgressForSwitchFormT1) End Sub Friend Delegate Sub EndProgressForSwitchFormDelegate(ByVal ProgressFormT1 As ProgressForSwitchForm) ' 结束进度条 Public Sub EndProgressBar() Dim EndProgressForSwitchFormDelegateT1 As New EndProgressForSwitchFormDelegate(AddressOf EndProgressForm) ProgressForSwitchFormT1.Invoke(EndProgressForSwitchFormDelegateT1, ProgressForSwitchFormT1) End Sub '''==================进度条End========================================================================#End Region
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表