Freeze user access
-
Hi, I have a form that does a lot of processing, some using background threads. What I want to do is "disable" any user actions until the processing is finished BUT still have the prgressbar continue if the user does try to click on the form somewhere. I have tried the lock method but this freezes the progressbar if a user clicks somewhere. I've also tried disabling the main form but that doesn't disable individual controls on that form, especially tab pages. I don't want to completly rewrite my program using all background threads. How can I disable any user interaction? TIA for any suggestions.
Glen Harvy
-
Hi, I have a form that does a lot of processing, some using background threads. What I want to do is "disable" any user actions until the processing is finished BUT still have the prgressbar continue if the user does try to click on the form somewhere. I have tried the lock method but this freezes the progressbar if a user clicks somewhere. I've also tried disabling the main form but that doesn't disable individual controls on that form, especially tab pages. I don't want to completly rewrite my program using all background threads. How can I disable any user interaction? TIA for any suggestions.
Glen Harvy
this.UseWaitCursor=true; can help you
#region signature my articles #endregion
-
this.UseWaitCursor=true; can help you
#region signature my articles #endregion
Unfortuately that doesn't stop the user from clicking on a control on the form causing the status bar to freeze.
Glen Harvy
-
Unfortuately that doesn't stop the user from clicking on a control on the form causing the status bar to freeze.
Glen Harvy
The normal way to solve this would be to open a modal dialog that holds the progress bar and a Cancel Button. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
The normal way to solve this would be to open a modal dialog that holds the progress bar and a Cancel Button. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
When opening the modal dialog how do I allow the mainForm to continue processing? I have always thought that the normal way of doing it was to create a backgroundworker, have it do the processing and update a progress bar on the main form.
Glen Harvy
-
When opening the modal dialog how do I allow the mainForm to continue processing? I have always thought that the normal way of doing it was to create a backgroundworker, have it do the processing and update a progress bar on the main form.
Glen Harvy
Hi Glen, Disabling a form can be handled in several ways: you can disable all the Controls (not recommended), hide the form, or make sure it can't get focus (that is exactly what you get with a modal dialog). There are many ways to get the work done; using a Thread, a ThreadPool thread, or a BackgroundWorker are amongst them. And that is independent of your form situation; the thread or whatever simply runs in the background; it gets organized by either the form or the modal dialog, your choice. Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google