Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB6 Please wait message

Posted on 2011-05-08
3
Medium Priority
?
1,202 Views
Last Modified: 2012-05-11
In the below code if the user selects OK button of the msg box, it executes 2 functions show1 and scan1. As its a timeconsuming process i need to display a 'please wait' msg for the user.
i tried using frame, but it displays after the 2 funs are run.

testmsg = MsgBox("Try Again,", 1, "Try Again!")
          If testmsg = 1 Then
           waitFrame.Visible = True
             show1   //function1
              scan1   //function2
             Exit Sub
             Else
             Exit Sub
 waitFrame.Visible = false
End If

0
Comment
Question by:AnnaJames77
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
Farzad Akbarnejad earned 2000 total points
ID: 35714597
Hello,
Place DoEvents statement before running show1.

testmsg = MsgBox("Try Again,", 1, "Try Again!")
If testmsg = 1 Then
    waitFrame.Visible = True
    DoEvents
    show1   //function1
    scan1   //function2
    Exit Sub
Else
    waitFrame.Visible = false    
    Exit Sub
End If


-FA
0
 

Author Comment

by:AnnaJames77
ID: 35714624
THANK YOU THANKYOU FarzadA: that worked. Can you please let me know what does the doevents used for?
0
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 35715119
Hello,
DoEvents switches control to the operating-environment kernel. Control returns to your application as soon as all other applications in the environment have had a chance to respond to pending events. This doesn't cause the current application to give up the focus, but it does enable background events to be processed. Other applications also includes other window (Windows and Controls) in your VB application.

-FA
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month20 days, 16 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question