3/20/2021 0 Comments File Download Progress
They are fully qualified releases, include all previous fixes and are available to you as part of your SupportLink Contract.
![]() Access the ultimate hybrid of cloud and on-premise next generation application development solutions. File Progress Code Still DownloadsThis code still downloads the file yet when I call startDownload() the window freezes as it downloads the file. I would like for the user to be able to see the progress change as the splash screen loads. Is there any way to fix this so that the user can see the progress of progressBar2 change. DownloadProgressChangedEventArgs has e.ProgressPercentage already there for you to use. I assigned this as: progressBar.Value e.ProgressPercentage, but not working. The whole idea of WebClient.DownloadFileAsync() is that it will spawn a worker thread for you automatically without blocking the calling thread. In startDownload(), you specified callbacks that modify controls which I assume were created by the UI thread. Thus if you call startDownload() from a background thread it will cause problems, because a thread can only modify UI elements it created. It then starts the download asynchronously and returns immediately. The UI thread will be notified when the progress changes and the code responsible for updating the progress bar control will execute on the UI thread, and there shouldnt be any problems. If you dont want get form freezed, you use startDownload() in another thread and make progress updating in cross-threaded. This thread starts when your code calls the RunWorkerAsync method. Im still doing some reading pertaining the trouble youre having so hopefully I might be able to come up with another solution. ![]() Making statements based on opinion; back them up with references or personal experience. Not the answer youre looking for Browse other questions tagged c asynchronous progress-bar or ask your own question.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |