MsgBox Function
/text/sbasic/shared/03010102.xhp
MsgBox function
MsgBox Function
Displays a dialog box containing a message and returns a value.
MsgBox (Prompt As String [,Buttons = MB_OK [,Title As String]]) As Integer
Integer
Named constant
Integer value
Definition
IDOK
1
OK
IDCANCEL
2
Cancel
IDABORT
3
Abort
IDRETRY
4
Retry
IDIGNORE
5
Ignore
IDYES
6
Yes
IDNO
7
No
Example:
Sub ExampleMsgBox
Dim sVar As Integer
sVar = MsgBox("Las Vegas")
sVar = MsgBox("Las Vegas",1)
sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title")
sVar = MsgBox("Las Vegas", MB_DEFBUTTON2 + MB_ICONSTOP + MB_ABORTRETRYIGNORE, "Dialog title")
End Sub