[Migrated content. Thread originally posted on 10 July 2009]
On one of our windows we populate a grid and depending on the ranges the user enters it could take a long time. I have attempted to create a progress window that has a Cancel button on it and it works well. However once the grid is built I cannot for the life of me figure out how to automatically close the progress window (with no user intervention).So to sum up user clicks a "go" button, progress window pops up, they can click cancel and change ranges and click "go" again. Or leave it to build and when it's done I would like to close the progress window. here is a sample of the code I have so far.
* This is the event for the button click
MainWin-PB-Go-Ev-Cmd-Clicked.
PERFORM Acu-ProgWin-Routine.
* This is the Progress window The GRID-REFRESH is performed in a thread to
* allow the user to click the cancel while the grid is being built.
ProgWin-Aft-Create.
SET WS-ABORT TO FALSE.
MOVE ZEROS TO WS-PROGRESS-HANDLE.
PERFORM THREAD GRID-REFRESH THRU GRID-EXIT
HANDLE WS-PROGRESS-HANDLE.
* Clicking the cancel button sets the WS-ABORT flag so the above that checks this flag can exit gracefully
ProgWin-PB-Cancel-Ev-Cmd-Clicked.
SET WS-ABORT TO TRUE.
So now suppose everything goes as planned and the user doesn't click cancel how do I close the window? I have tried adding the following code to the end of the GRID-REFRESH THRU GRID-EXIT routine but it doesn't close the window.
PERFORM Acu-Progwin-Exit.
Any ideas or direction would be helpful thanks. keep in mind I'm using acubench to develop this also :-)



