加载时如果没有进度条会给人舒服的感觉,以下是进度条的代码,在加载函数前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新闻热点
疑难解答