|
-
Sep 22nd, 2005, 04:47 PM
#1
Thread Starter
New Member
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.
-
Sep 22nd, 2005, 04:50 PM
#2
Hyperactive Member
Re: a msgbox or window hints the programming still running
-
Sep 22nd, 2005, 04:52 PM
#3
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:
Option Explicit
Private Sub Form_Load()
' You want the statement to execute only twice
' so you would use the Modulo function. This will fire
' at 50 and 100
Dim x As Integer
For x = 1 To 100
If x Mod 50 = 0 Then DoEvents
Next x
End Sub
-
Sep 22nd, 2005, 05:10 PM
#4
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|