Somewhere in the code, waitHandle is used to perform some action. However, the thing with waithandle is that the form freezes, waiting for the completion of some action. Thus, the following code will not work:
frmProgressBar.show(); int successOrFail = PerformSynchronousActionUsingWaitHandle(); frmProgressBar.close(); frmMainScreen.show();
This will not work, since frmProgressBar will be frozen instead. I really need to save line # 1, line # 3 and line # 4, but how can I rewrite the PerformSynchronousActionUsingWaitHandle () function so that the operation is still synchronous, but the progress bar is displayed. I can get around this by showing a progress bar in another thread, but the system design is such that it will be very dirty.
Hao wooi lim
source share