중단됩니다.백그라운드 프로세스 내가 백그라운드 프로세스를 응용 vb.net
"BackGroundWorker"에 통합하여 진행률 막대에 연결하려고합니다.
그러나 프로세스가 실행 중일 때 응용 프로그램이 더 이상 중단되지 않지만 진행률 표시 줄은 수행합니다.
위의 기능을 수행하는 동안 진행률을 0 - 50 %에서 진행하고 싶습니다. 그러나 현재 진행률 표시 줄은 프로세스가 완료 될 때까지 0 %에서 50 %로 점프합니다. 사용하여
Private Sub bgwLongTask_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgwLongTask.DoWork
For i As Integer = 1 To 10
' If we should stop, do so.
If (bgwLongTask.CancellationPending) Then
' Indicate that the task was canceled.
e.Cancel = True
Exit For
End If
CheckForInternetConnection()
LoadingScreen.CheckForIllegalCrossThreadCalls = False
Me.Text = i
' Notify the UI thread of our progress.
bgwLongTask.ReportProgress(i * 10)
Next i
End Sub
Private Sub bgwLongTask_ProgressChanged(ByVal sender As System.Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles bgwLongTask.ProgressChanged
If e.ProgressPercentage >= 0% And e.ProgressPercentage <= 50% Then
lblStatus.Text = "Checking Netowrk ..."
Else
lblStatus.Text = "Loading ..."
End If
prgPercentComplete.Value = e.ProgressPercentage
End Sub
:
LoadingScreen.CheckForIllegalCrossThreadCalls = False
Me.Text = i
내가 CheckForInternetConnection()
이 완료 될 때까지 진행 표시 줄도 시작되지 않는 것을 볼 수 있습니다.
누군가이를 도와 주실 수 있습니까?
매우 감사드립니다. 감사.