İngilizce dilinde oku

Aracılığıyla paylaş


MessageBoxButtons Sabit listesi

Tanım

Üzerinde MessageBoxhangi düğmelerin görüntüleneceğini tanımlayan sabitleri belirtir.

C#
public enum MessageBoxButtons
Devralma
MessageBoxButtons

Alanlar

Name Değer Description
AbortRetryIgnore 2

İleti kutusunda Durdur, Yeniden Dene ve Yoksay düğmeleri bulunur.

CancelTryContinue 6

İleti kutusunda İptal, Yeniden Dene ve Devam Et düğmelerini içerdiğini belirtir.

OK 0

İleti kutusunda Tamam düğmesi bulunur.

OKCancel 1

İleti kutusunda Tamam ve İptal düğmeleri bulunur.

RetryCancel 5

İleti kutusunda Yeniden Dene ve İptal düğmeleri bulunur.

YesNo 4

İleti kutusunda Evet ve Hayır düğmeleri bulunur.

YesNoCancel 3

İleti kutusunda Evet, Hayır ve İptal düğmeleri bulunur.

Örnekler

Aşağıdaki kod örneği, kullanıcıya formun kapanmasını önleme fırsatı vermek için nasıl kullanılacağını MessageBox gösterir. Bu örnek, yönteminin formun olayından FormClosing çağrılsını gerektirir.

C#
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    const string message =
        "Are you sure that you would like to close the form?";
    const string caption = "Form Closing";
    var result = MessageBox.Show(message, caption,
                                 MessageBoxButtons.YesNo,
                                 MessageBoxIcon.Question);

    // If the no button was pressed ...
    if (result == DialogResult.No)
    {
        // cancel the closure of the form.
        e.Cancel = true;
    }
}

Açıklamalar

Bu numaralandırma sınıfı tarafından MessageBox kullanılır.

Şunlara uygulanır

Ürün Sürümler
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Ayrıca bkz.