Results 1 to 9 of 9

Thread: [RESOLVED] Progressbar-only form

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [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)?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    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.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    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...?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  7. #7

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    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.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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
    Code:
    Form1.Show vbModal

  9. #9

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    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.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width