Results 1 to 3 of 3

Thread: Confusing DoEvents problem [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Confusing DoEvents problem [RESOLVED]

    Hi,

    I have a program that processes something, then displays a messagebox giving the results.

    Now, as soon as the user clicks the okay button on the messagebox, i want the application to end.

    The way I have done that is this way:
    VB Code:
    1. MsgBox("Done", MsgBoxStyle.Information, "Complete")
    2.             Application.Exit()
    However I have found that it just seems to exit the application the second it puts the messagebox up. It doesn't wait for the user to press the okay button. I think this is because of the
    "Application.DoEvents()" I put at the start of the sub. The problem is tho, i need this for it to show the message box at all. I dunno why, but it's the way i've coded it - very weirdly!!!

    So is there a way to make the code just wait for the user to press the okay button on the message box before it processes the application.exit() ?

    Thanks very much! I've tried lots of things but nothing seems to work. I either get the messagebox to popup, but the program doesnt end when u press okay. or the current situation where it doesn't come up at all and just ends.
    Last edited by LITHIA; Jul 20th, 2004 at 09:40 AM.

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