发布时间:2025-12-09 20:00:20 浏览次数:4
加载时如果没有进度条会给人舒服的感觉,以下是进度条的代码,在加载函数前StartProgressBar(),执行完之后EndProgressBar()
#Region "进度条"'''==================进度条Begin========================================================================Private ProgressForSwitchFormT1 As ProgressForSwitchFormPrivate ThreadT2 As ThreadPrivate Sub ShowProgressForSwitchForm(ByVal ProgressFormT1 As ProgressForSwitchForm)Application.Run(ProgressFormT1)End SubPrivate Sub EndProgressForm(ByVal ProgressFormT1 As ProgressForSwitchForm)TryProgressFormT1.Close()Catch ex As ExceptionEnd TryEnd Sub' 开始进度条Public Sub StartProgressBar()ProgressForSwitchFormT1 = New ProgressForSwitchForm()ThreadT2 = New Threading.Thread(AddressOf ShowProgressForSwitchForm)ThreadT2.Start(ProgressForSwitchFormT1)End SubFriend 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