I want the progress bar to have certain values after specific time intervals. but the Sleep function Stops the ui from appearing.
private: System::Void ProgressBarSave_Load(System::Object^ sender, System::EventArgs^ e)
for (int i = 0; i < 4; i++)
progressBar1 -> Value +=25; if ( i == 3)
Where do I start?
If you want a progress bar to show progress, then sleeping the thread is always going to be a silly move. Firstly because it stops the UI thread from actually changing the display, and secondly, because it doesn't allow any program to actually be made unless you have that working on a different thread. And if you have it working on a different thread, then why are you reporting progress as if it wasn't?
There are a couple of possibilities: make the progress bar a Marquee in which case it will rotate itself without your intervention, or do the job properly with a BackgroundWorker and ReportProgress
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)