MsgBox Statement

Bir mesajı içeren bir iletişim penceresi gösterir.

Sözdizimi:


   MsgBox prompt As String [,buttons = MB_OK [,title As String]]
   response = MsgBox( prompt As String [,buttons = MB_OK [,title As String]])

Parametreler:

prompt: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).

title: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application.

buttons: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. buttons represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values:

İsimlendirilmiş sabit

Tam sayı değeri

Tanımlama

MB_OK

0

Sadece Tamam düğmesini görüntüle.

MB_OKCANCEL

1

Tamam ve İptal düğmelerini görüntüle.

MB_ABORTRETRYIGNORE

2

İptal, Yeniden Dene ve Yoksay düğmelerini görüntüle.

MB_YESNOCANCEL

3

Evet, Hayır ve İptal düğmelerini görüntüle.

MB_YESNO

4

Evet ve Hayır düğmelerini görüntüle.

MB_RETRYCANCEL

5

Yeniden Dene ve İptal düğmelerini görüntüle.

MB_ICONSTOP

16

İletişim kutusuna Durdur simgesini ekle.

MB_ICONQUESTION

32

İletişim kutusuna Soru simgesini ekler.

MB_ICONEXCLAMATION

48

İletişim kutusuna Ünlem simgesini ekle.

MB_ICONINFORMATION

64

İletişim kutusuna Bilgi simgesini ekle.

128

Varsayılan düğme olarak iletişim kutusundaki ilk düğme.

MB_DEFBUTTON2

256

Varsayılan düğme olarak iletişim kutusundaki ikinci düğme.

MB_DEFBUTTON3

512

Varsayılan düğme olarak iletişim kutusundaki üçüncü düğme.


Hata kodları:

5 Geçersiz yordam çağrısı

Örnek:


Sub ExampleMsgBox
 Const sText1 = "Beklenmedik bir hata oluştu."
 Const sText2 = "Ancak, programın çalışması devam edecek."
 Const sText3 = "Hata"
 MsgBox(sText1 + Chr(13) + sText2,16,sText3)
 MsgBox(sText1 + Chr(13) + sText2, MB_ICONSTOP, sText3)
End Sub

Lütfen bizi destekleyin!