Hi all,
I ran into a headache problem. I have a windows form with a progress
bar on it. Then I new a thread to do calculation for a long time. I
want the progress bar to show the calculation progress. So I use a
shared variable in calculation thread to allow main thread read it
periodically in order to show the progress. Quesion comes out. If I
just wait and don't make any operation during the whole calculation,
the main form is OK, with progress bar increased step by step. But If
I click other application or just drag the form, main form will have
no response until the calculation finished. At first I think that
maybe the calculation is too tight to be a circle. So I add several
sleep() in it. But this method is of no use. I have no idea this time.
Anybody can help me? Thanks in advance!