To emulate the standard messagebox, you need to show the form as
modal (formX.show 1), and if you require a return value (other than
ok), you need to code for obtaining that value before destroying the
message box.
I did a similar thing, and used the following routine. It won't all
be applicable to your situation, but you can see the idea.
'global variable
MsgAction as Integer 'return value from the messagebox
Function GetMessage(msgType%, xtraInfo$, iconNo&) As Integer
Dim btnPanel%
msgExtraStrInfo$ = xtraInfo$
dlgMsg!Msg = fGetMsg$(msgType%, ActivePanel%)
dlgMsg!MsgPnl(btnPanel%).ZOrder 0
'if a valid icon value is specified, load & display it too.
If iconNo& >= IDI_HAND And iconNo& <= IDI_ASTERISK Then
Dim hIcon&, success&
'clear the picturebox & set AutoRedraw to true.
dlgMsg!Picture1 = LoadPicture("")
dlgMsg!Picture1.AutoRedraw = True
'load the icon & draw it to the picturebox.
hIcon& = LoadIcon(0&, iconNo&)
success& = DrawIcon(dlgMsg!Picture1.hDc, 0&, 0&, hIcon&)
End If
DoEvents
dlgMsg.Show 1
GetMessage% = MsgAction%
End Function