I have a main form that does a lengthy database query. Before I fire off the
query, I need to pop up another form that contains a progress bar and a Close button. The progress bar updates for 30 seconds and then pops up a timeout message with an OK button that closes the form when pressed. Also, the user has an option of closing the form while the bar is being updated. Thus, this form needs to be threaded.
The main form calls the progress bar form via thread because it has to continue with the Database query while the progress bar is being updated in order to terminate the progress bar form if the query finishes before the 30 second timeout.
This seemingly minor effort is driving me nuts dues to cross threading issues. I've played around with delegates but can't get it right.
Has anyone doen this before and could provide some code or suggestions on how to accomplish this?
Thanks. James
query, I need to pop up another form that contains a progress bar and a Close button. The progress bar updates for 30 seconds and then pops up a timeout message with an OK button that closes the form when pressed. Also, the user has an option of closing the form while the bar is being updated. Thus, this form needs to be threaded.
The main form calls the progress bar form via thread because it has to continue with the Database query while the progress bar is being updated in order to terminate the progress bar form if the query finishes before the 30 second timeout.
This seemingly minor effort is driving me nuts dues to cross threading issues. I've played around with delegates but can't get it right.
Has anyone doen this before and could provide some code or suggestions on how to accomplish this?
Thanks. James
Comment