Top.Mail.Ru
Ответы

Как использовать MsgBox в VBS?

По дате
По рейтингу
Аватар пользователя
Оракул

Private Sub Command1_Click()
Dim Msg As String
Dim Ans As VbMsgBoxResult
' Fill Message string
Msg = "This may take a while. Click OK to continue" & Chr(vbKeyReturn)
Msg = Msg & "If you click Cancel, to abort"
' Set icon to information (question mark)
' Set buttons to OK and Cancel
' Show Message Box
Ans = MsgBox(Msg, vbOKCancel + vbInformation, "Msgbox Example - OK Cancel")

' If the user clicked cancel...
If Ans = vbCancel Then
MsgBox "Cancelled"
Exit Sub
End If
End Sub