LibreOffice 24.8 Help
顯示一個包含訊息的對話方塊,並傳回一個值。
MsgBox (Prompt As String [,Buttons = MB_OK [,Title As String]]) As 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 | 
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