Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic .NET (http://www.programmingforums.org/forum19.html)
-   -   Checking to see if a message box has displayed (http://www.programmingforums.org/showthread.php?t=13459)

surf3rb0y Jul 2nd, 2007 11:49 AM

Checking to see if a message box has displayed
 
How would one go about checking to see if a message box is currently being displayed?


THanks

melbolt Jul 2nd, 2007 12:23 PM

What are you trying to do, need a bit more detail.

Not sure if this is what you're looking for, but you could use this to determine if the messagebox you opened earlier had its "ok" clicked or whether it was closed or what.


:

  1.         Dim bla As New MsgBoxResult
  2.         bla = MsgBox("poop")
  3.  
  4.  
  5.         If bla = MsgBoxResult.Ok Then
  6.         'ok was clicked on messagebox
  7.         End If


surf3rb0y Jul 2nd, 2007 1:11 PM

what if i want to see if its currently being displayed?

john Wesley Jul 2nd, 2007 5:03 PM

Have you tried passing the Form object, which can be referenced using the 'Me' keyword, as the IWin32Window owner and checking if it would then be exposed via the 'OpenForms' property?

Another alternative after setting the owner would be to try and access handles via the calling Form properties that are associated with this instance, thereby you could define if any of the windows are your messagebox by conditional means (ie. matching elements such as title bar text).

mattireland Jul 5th, 2007 5:51 PM

Alternatively, you could just try compiling and running and looking to see if it is being displayed?

DaWei Jul 5th, 2007 6:19 PM

LOL! :beard:


All times are GMT -5. The time now is 2:44 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC