[RESOLVED] Progressbar-only form
I want to use a progressbar while a lengthy calculation is in progress. Now, I want to place it in a small form consisting only of the progressbar, a title, a label and a cancel button. The form must be modal and self-closing when done.
My question is, do I have to place the calculating code in this form (or call it from it)?
Re: Progressbar-only form
Quote:
Originally Posted by krtxmrtz
My question is, do I have to place the calculating code in this form (or call it from it)?
Call it from it.
In the code doing the calculation, you would need to preface the progressbar control with the form's name, i.e.
Code:
frmProgressBar.ProgressBar1.Etc
Re: Progressbar-only form
Quote:
Originally Posted by Hack
Call it from it.
In the code doing the calculation, you would need to preface the progressbar control with the form's name, i.e.
Code:
frmProgressBar.ProgressBar1.Etc
My intention was to use this form as a sort of universal progressbar to be used for different tasks, so I would pass it the title, message to display and now it seems I have to pass it a parameter as well to indicate what procedure (in the main form) should be called. Maybe it's not worth that much overhead.
Re: Progressbar-only form
I've done the sort of thing that you want to do and it does take some work to set it up. However, once completed, it can be a very cool affect.
The alternative is to have the progress bar on the form from which the process is being executed.
Re: Progressbar-only form
Quote:
Originally Posted by Hack
...
The alternative is to have the progress bar on the form from which the process is being executed.
That's he way I have it now, but I want to prevent the user from starting other tasks (click on buttons,etc) until the calculation is completed. Maybe I should lock the window or something...?
Re: Progressbar-only form
You could always show the form as modal and/or disable all of the buttons on the form until the process is complete.
Re: Progressbar-only form
Quote:
Originally Posted by Hack
You could always show the form as modal and/or disable all of the buttons on the form until the process is complete.
If I have to disable the varous menus, buttons and whatnot one by one (and previously save their current status for restoring it later) maybe the progressbar form is not a bad idea after all. Unless I can temporarily make the form modal without much effort.
Re: Progressbar-only form
I was talking about just the buttons on the form running the calculation, not your entire project.
Showing a form as modal is a simple as
Re: Progressbar-only form
Well, I think the best I can do is try to implement the modal progressbar form for one calculation case only while preserving the current main form's progress bar until I can get rid of it after I have (gradually) added all the necessary functionalities for all the other tasks that may require it.
At any rate, I think my opening question was already answered.