MsgBox Statement
Pokazuje dijalog box koji prikazuje poruku.
Sintaksa:
MsgBox Text kao String [,Type As Integer [,DialogueBoxTitle As String]] (As Statement) or MsgBox (Text As String [,Type As Integer [,Dialogue Boxtitle As String]]) (As Function)
Parametar:
Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).
DialogueBoxTitle: String prikazan kao naslov dijaloga. ako je izvrsen, naslov pokazuje ime respektivne aplikaicje.
Vrsta: ABilo koji broj koji je specifiran u dijalog tipu, kao i broj i tajp dugmeta da prikaze i ikona tip Vrsta je kombinacija bit paterna koji je kombinacija elemenata definisanih dodavajuci njihov rezultat:
Named constant |
Integer value |
Definition |
MB_OK |
0 |
Display OK button only. |
MB_OKCANCEL |
1 |
Display OK and Cancel buttons. |
MB_ABORTRETRYCANCEL |
2 |
Display Abort, Retry, and Ignore buttons. |
MB_YESNOCANCEL |
3 |
Display Yes, No, and Cancel buttons. |
MB_YESNO |
4 |
Display Yes and No buttons. |
MB_RETRYCANCEL |
5 |
Display Retry and Cancel buttons. |
MB_ICONSTOP |
16 |
Add the Stop icon to the dialog. |
MB_ICONQUESTION |
32 |
Add the Question icon to the dialog. |
MB_ICONEXCLAMATION |
48 |
Add the Exclamation Point icon to the dialog. |
MB_ICONINFORMATION |
64 |
Add the Information icon to the dialog. |
|
128 |
First button in the dialog as default button. |
MB_DEFBUTTON2 |
256 |
Second button in the dialog as default button. |
MB_DEFBUTTON3 |
512 |
Third button in the dialog as default button. |
Primjer:
Sub ExampleMsgBox
Const sText1 = "NEpredvidjena greska."
Const sText2 = "program se nastavlja."
Const sText3 = "greska"
MsgBox(sText1 + Chr(13) + sText2,16,sText3)
MsgBox(sText1 + Chr(13) + sText2, MB_ICONSTOP, sText3)
End Sub