Busy Signal 200 POINTS

I have a function which takes about 8 or 9 seconds to finish loading. What i would like is a "working code" example of how to make a little message box or something which would state "working please wait" until the function was through. Don't really want a message box because you have to click the OK Button. Just want it to do this while working and then quitely disappear. Got more points if this is too hard peoples.
Thanks
rockroad
rockroadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VbmasterCommented:
What about creating a dummy form for this, with just a label saying "Have patience.. Calculating some really hard stuff". Whenever you want to show the form you can use TheDummyForm.Show and hide it with code like Unload TheDummyForm.
0
rockroadAuthor Commented:
Vbmaster--You got something like this to show me? I'm not that great at programming with vb 5.0
For instance, the first question that comes to my "peabrain" is how/when will the dummyform know when the other function is finished ? Anyway, if you have something to add i will be waiting!
Thanks
rockroad
0
pacificdbCommented:
1. Create a small form with no buttons. Set its Height property to zero. Set the form Caption to "Working. Please Wait...", or some such message.

2. Create a global Sub as follows:

   Public Busy(intStatus as Boolean)
      If intStatus then
          Working.Show
      Else
          Unload Working
      End If
   End Sub

3. Call Busy(True) when you enter your lengthy function, and Busy(False) when you exit it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

pacificdbCommented:
By the way, set the form's Name property to "Working".
0
rockroadAuthor Commented:
pacificdb--thanks for your comment. I tried your code and got an error:

Public Working(intStatus as Boolean) gives the error and "as" is highlighted?

I'm using visual basic 5.0
I tried placing the code into my form and also is a module and got the same error when i tried to run the program. Any help on this ?
Thanks
rockroad
0
crazymanCommented:
try
Public sub Busy(intStatus as Boolean)
                                                  If intStatus then
                                                      Working.Show
                                                  Else
                                                      Unload Working
                                                  End If
                                               End Sub

he left the sub bit out
0
pacificdbCommented:
Thanks crazyman, it's always the simple stupid mistakes isn't it ;->
0
crazymanCommented:
Hehe sure is .
Oh and rockroad if that is what you wanted please give the points to pacificdb as his answer was correct he just missed out one word.
Thanks.
0
rockroadAuthor Commented:
Hey crazyman and Pacificdb--all worked fine after the missing word was fixed. Please leave instructions on how to award the points since this was only commmented. I am new to the new system here!
Thanks to both of you!!!
rockroad
0
mcriderCommented:
Just throwing my 2 cents in...

You may actually have to do this:


Public sub Busy(intStatus as Boolean)
   If intStatus then
       Working.Show
       Working.Refresh
       DoEvents
   Else
       Unload Working
   End If
End Sub


Otherwise, the system may not allocate enough resources to properly paint the Working screen when you show the form...


Cheers!
0
crazymanCommented:
Just click on accept comment as answer on one of Pacificdb questions that will give him the points
0
crazymanCommented:
i mean on one of his comments not questions
0
rockroadAuthor Commented:
Hey you guys, mcrider, you were right about your code too ! Thanks to all and sorry about no points for some of you. You all participated !!!

Thanks
rockroad
0
mcriderCommented:
So who are you going to award the points to??


Cheers!
0
rockroadAuthor Commented:
pacificdb gets the points because he listed the original code. I hope everyone agree's with this.
Thanks
rockroad
0
rockroadAuthor Commented:
Thanks Again pacificdb !!!
rockroad
0
pacificdbCommented:
We're here to help :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.