Hi there,
I have wrote a program that do a bit of calculations that takes about 10 min to complete, therefore I need to show a progress to user. I used a percentage in status bar to show the current status of program.
The problem is for updating the number after each iteration I use me.refresh to show the percentage. BUT whenever the program lose the focus for example working on other stuffs, the program cannot update the percentage anymore. And above the form shows not responding but do the job until get the result.

I don't khow what to do? Maybe I should go for multithreading but i don't know anything about that. Is there any other solution to this problem.

I really appreciate any help
Afi

Recommended Answers

All 6 Replies

Member Avatar for Unhnd_Exception

You have no other options but running on another thread.

See if you can put together a simplified operation of what your doing maybe it could be answered.

As what Unhnd Exception said. You'll have to deal again with another thread.
Just try it.

Thanks for the responses.
It seems I should learn how to make thread, do you know any good tutorial.

Check out this thread about using a BackgroundWorker to run code on a separate thread.
.As for updating, try Application.DoEvents() right after setting your progress.

Thanks a lot application.doevents() solved my problem.
But for sure I should learn multithreading it is really useful.

error

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.