MsgBox Function

Zobraz├ş dial├│gov├ę okno obsahuj├║ce spr├ívu a vr├íti hodnotu.

Syntax:


MsgBox (Text As String [,Typ As Integer [,TitulokDialogu As String]])

Návratová hodnota:

Cel├ę ─Ź├şslo

Parameter:

Text: Re┼ąazec zobrazen├Ż ako spr├íva v dial├│govom okne. Zalomenie riadku ja mo┼żn├ę vlo┼żi┼ą pomocou Chr$(13).

TitulokDialogu: Re┼ąazec zobrazen├Ż v titulnej li┼íte dial├│gu. Ak je vynechan├Ż, zobraz├ş sa v titulnej li┼íte n├ízov zodpovedaj├║cej aplik├ície.

Typ: Ak├Żko─żvek celo─Ź├şseln├Ż v├Żraz, ktor├Ż ur─Źuje druh dial├│gu a taktie┼ż po─Źet a druh zobrazen├Żch tla─Źidiel a druh ikony. Typ predstavuje kombin├íciu bitov├Żch vzoriek, tak┼że je mo┼żn├ę pou┼żi┼ą kombin├íciu prvkov s├║─Źtom ich hodn├┤t:

Hodnoty

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.


Návratová hodnota:

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


Error codes:

5 Neplatn├ę volanie proced├║ry

Pr├şklad:


Sub ExampleMsgBox
Dim sVar As Integer
 sVar = MsgBox("Bratislava")
 sVar = MsgBox("Bratislava",1)
 sVar = MsgBox( "Bratislava",256   16   2,"Nazov dialogu")
 sVar = MsgBox("Las Vegas", MB_DEFBUTTON2 + MB_ICONSTOP + MB_ABORTRETRYCANCEL, "Dialog title")
End Sub

Please support us!