Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal _
hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType _
As Long) As Long
Private Sub Form_Load()
Dim rval As Long
rval = MessageBox(Me.hwnd, "Hello.How r u?", "Test Message", MB_ABORTRETRYIGNORE)
Select Case rval
Case 1
MsgBox "Ok button Pressed"
Case 2
MsgBox "Cancel button Pressed"
Case 3
MsgBox "Abort button Pressed"
Case 4
MsgBox "Retry button Pressed"
Case 5
MsgBox "Ignore button Pressed"
Case 6
MsgBox "Yes button Pressed"
Case 7
MsgBox "No button Pressed"
End Select
End
End Sub