Results 1 to 4 of 4

Thread: a msgbox or window hints the programming still running

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    1

    a msgbox or window hints the programming still running

    my program needs to take more than 2 min to perform the computation. I would like to remind the user that the program is still running. However, this reminding window or msgbox does not show up until the program finishes running. I guess that it did show up but did not refresh. Can anyone help me to write a correct reminding window or msgbox?
    Thanks a lot.

  2. #2
    Hyperactive Member vincentg's Avatar
    Join Date
    Jun 2005
    Location
    Chicago IL, USA
    Posts
    261

    Re: a msgbox or window hints the programming still running

    Your doing a loop????

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: a msgbox or window hints the programming still running

    Welcome to VBF!

    You can use DoEvents to let the computer process other events. If your project has a loop, put DoEvents in like this. You should only use as many as are required. If you have too many, you will actually slow down your app.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. ' You want the statement to execute only twice
    5. ' so you would use the Modulo function.  This will fire
    6. ' at 50 and 100
    7.   Dim x As Integer
    8.   For x = 1 To 100
    9.     If x Mod 50 = 0 Then DoEvents
    10.   Next x
    11. End Sub

  4. #4
    Lively Member BradBrening's Avatar
    Join Date
    Oct 2001
    Location
    Gillespie, IL
    Posts
    102

    Re: a msgbox or window hints the programming still running

    Maybe a better solution would be a progress bar or some other indicator on the form that is displaying when the process is running.

    A message box is a modal window, meaning your code stops and waits for the message box to be discarded before it continues processing.

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