vb.net - vb net backgroundworker + progress bar -
I want to automatically create the progress bar which will pop up when I ran my program ..
My program has 6 functions / sub which takes a considerable amount of time to complete the running query, it is It is about 1-2 minutes for the RunWorkerAsync Do_work progress progress RunWorkerCompleted Stop because I use I do not know the TI passed to me So I can use random integer number for First of all, you should set Second, you should compare Third, if input
backgroundworker to handle the thread and to combine it with the
progress bar
Personal Sub ButtonX1_Click (ByVal Handle ButtonX1.Click) as the System.Object, as byVal e System.EventArgs. Click BackgroundWorker1.WorkerReportsProgress = True BackgroundWorker1.RunWorkerAsync () End Sub
Private sub BackgroundWorker1_DoWork (ByVal as the object, byVal e System.ComponentModel.DoWorkEventArgs ) 100000000 i as integer = 0 to create_tree handles for BackgroundWorker1.DoWork () localtree () Localfrek () create_combination () showresult () if I mo d 10000000 again background 1. Report progress (i / 100) end if the next ending sub
1_ProgressChanged by Private sub background (ByVal this object As, byVal e System.ComponentModel.ProgressChangedEventArgs) Handle BackgroundWorker1.ProgressChanged ProgressBar1.Visible = True ProgressBar1.Value = e.ProgressPercentage End Sub
Private Sub BackgroundWorker1_RunWorkerCompleted (ByVal as the object, as byVal e System.ComponentModel.RunWorkerCompletedEventArgs) BackgroundWorker1.RunWorkerCompleted MessageBox.Show ("Work Completed!") End Sub Handle Troubleshooting
progress bar did not pop up
for loop which I use in the
Do_work event
loop , do you please correct me in my program Are not you help? Thank you very much .. :)
visible ProjectBar property> before calling
RunWorker async .
i mod 10000000
i goes up to 10000000 then
i / 100 going forward 100.
Comments
Post a Comment