ExceptionMessageBox Oluşturucusu (String, String, ExceptionMessageBoxButtons, ExceptionMessageBoxSymbol, ExceptionMessageBoxDefaultButton)
Oluşturur bir örnek , ExceptionMessageBox ile sağlanan en üst düzey hata iletisi metni ve iletişim kutusunu başlığını ileti kutusu.Yöntem ayrıca düğmeler, simge ve özel durum ileti kutusunda görüntülenecek varsayılan düğmeye belirtir.
Ad Alanı: Microsoft.SqlServer.MessageBox
Derleme: Microsoft.ExceptionMessageBox (Microsoft.ExceptionMessageBox içinde.dll)
Sözdizimi
'Bildirim
Public Sub New ( _
text As String, _
caption As String, _
buttons As ExceptionMessageBoxButtons, _
symbol As ExceptionMessageBoxSymbol, _
defaultButton As ExceptionMessageBoxDefaultButton _
)
'Kullanım
Dim text As String
Dim caption As String
Dim buttons As ExceptionMessageBoxButtons
Dim symbol As ExceptionMessageBoxSymbol
Dim defaultButton As ExceptionMessageBoxDefaultButton
Dim instance As New ExceptionMessageBox(text, caption, _
buttons, symbol, defaultButton)
public ExceptionMessageBox(
string text,
string caption,
ExceptionMessageBoxButtons buttons,
ExceptionMessageBoxSymbol symbol,
ExceptionMessageBoxDefaultButton defaultButton
)
public:
ExceptionMessageBox(
String^ text,
String^ caption,
ExceptionMessageBoxButtons buttons,
ExceptionMessageBoxSymbol symbol,
ExceptionMessageBoxDefaultButton defaultButton
)
new :
text:string *
caption:string *
buttons:ExceptionMessageBoxButtons *
symbol:ExceptionMessageBoxSymbol *
defaultButton:ExceptionMessageBoxDefaultButton -> ExceptionMessageBox
public function ExceptionMessageBox(
text : String,
caption : String,
buttons : ExceptionMessageBoxButtons,
symbol : ExceptionMessageBoxSymbol,
defaultButton : ExceptionMessageBoxDefaultButton
)
Parametreler
- text
Tür: System.String
Hata metni iletinin üst düzey.
- caption
Tür: System.String
Özel durum ileti kutusunun iletişim kutusunu başlık.
- buttons
Tür: Microsoft.SqlServer.MessageBox.ExceptionMessageBoxButtons
ExceptionMessageBoxButtons Numaralandırma özel durum ileti kutusunda görüntülenecek düğmeleri belirtir.
- symbol
Tür: Microsoft.SqlServer.MessageBox.ExceptionMessageBoxSymbol
ExceptionMessageBoxSymbol Numaralandırma özel durum ileti kutusunda görüntülenecek simgeyi belirtir.
- defaultButton
Tür: Microsoft.SqlServer.MessageBox.ExceptionMessageBoxDefaultButton
ExceptionMessageBoxDefaultButton Numaralandırma özel durum ileti kutusunda varsayılan düğmeye belirtir.
Örnekler
// Define the message and caption to display.
string str = @"Are you sure you want to delete file 'c:\somefile.txt'?";
string caption = "Confirm File Deletion";
// Show the exception message box with Yes and No buttons.
ExceptionMessageBox box = new ExceptionMessageBox(str,
caption, ExceptionMessageBoxButtons.YesNo,
ExceptionMessageBoxSymbol.Question,
ExceptionMessageBoxDefaultButton.Button2);
if (DialogResult.Yes == box.Show(this))
{
// Delete the file.
}
' Define the message and caption to display.
Dim str As String = "Are you sure you want to delete file 'c:\somefile.txt'?"
Dim caption As String = "Confirm File Deletion"
' Show the exception message box with Yes and No buttons.
Dim box As ExceptionMessageBox = New ExceptionMessageBox(str, _
caption, ExceptionMessageBoxButtons.YesNo, _
ExceptionMessageBoxSymbol.Question, _
ExceptionMessageBoxDefaultButton.Button2)
If Windows.Forms.DialogResult.Yes = box.Show(Me) Then
' Delete the file.
End If