Hi, the following is some code from the Utter Access forums for creating a timed message box. It works perfectly for me and might be useful for others as well.
Option Explicit
Public Property Get oMsgBox() As Object
Set oMsgBox = CreateObject("WScript.Shell"
'// Usage: oMsgBox.PopUp "Message Text",SecondsToDisplay,"Title of Message",vbOKOnly + vbInformation
End Property
Private Sub Command1_Click()
'// This demonstrates how the Timed Message Box can be used
'// much in the way a standard message box is used
Dim mRslts
mRslts = oMsgBox.PopUp("Message Body Text", 3, "Message Title Text Goes Here", vbYesNo + vbQuestion)
If mRslts = vbYes Then
oMsgBox.PopUp "Selected Yes", 1, "Yes", vbOKOnly + vbInformation
ElseIf mRslts = vbNo Then
oMsgBox.PopUp "Selected No", 1, "No", vbOKOnly + vbInformation
Else '// message box timed out, yeilding a value of -1
oMsgBox.PopUp "Timed Out", 1, "No Selection", vbOKOnly + vbInformation
End If
End Sub
Is it possible to locate a message box created this way to someplace other than the center of the screen using Movesize, the Top property other methods?
Thanks, Dan
Option Explicit
Public Property Get oMsgBox() As Object
Set oMsgBox = CreateObject("WScript.Shell"
'// Usage: oMsgBox.PopUp "Message Text",SecondsToDisplay,"Title of Message",vbOKOnly + vbInformation
End Property
Private Sub Command1_Click()
'// This demonstrates how the Timed Message Box can be used
'// much in the way a standard message box is used
Dim mRslts
mRslts = oMsgBox.PopUp("Message Body Text", 3, "Message Title Text Goes Here", vbYesNo + vbQuestion)
If mRslts = vbYes Then
oMsgBox.PopUp "Selected Yes", 1, "Yes", vbOKOnly + vbInformation
ElseIf mRslts = vbNo Then
oMsgBox.PopUp "Selected No", 1, "No", vbOKOnly + vbInformation
Else '// message box timed out, yeilding a value of -1
oMsgBox.PopUp "Timed Out", 1, "No Selection", vbOKOnly + vbInformation
End If
End Sub
Is it possible to locate a message box created this way to someplace other than the center of the screen using Movesize, the Top property other methods?
Thanks, Dan