VB 中添加进度条
加載時如果沒有進度條會給人舒服的感覺,以下是進度條的代碼,在加載函數前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總結
- 上一篇: 天空卫士陆明:数据法在企业如何落地
- 下一篇: 阿里图标,共性