加載時如果沒有進度條會給人舒服的感覺,以下是進度條的代碼,在加載函數前Startapplication.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
新聞熱點
疑難解答