ExceptionMessageBox.Show 메서드

정의

예외 메시지 상자를 표시합니다.

오버로드

Show(IWin32Window)

예외 메시지 상자를 부모 창 가운데에 모달 대화 상자로 표시합니다.

Show(IntPtr, String, String, String, String, String, String, String)

예외 메시지 상자를 표시합니다. 정보를 제공하기 위해서만 확인됩니다. 지원 안 됨 향후 호환성은 보장되지 않습니다.

Show(IWin32Window)

예외 메시지 상자를 부모 창 가운데에 모달 대화 상자로 표시합니다.

public:
 System::Windows::Forms::DialogResult Show(System::Windows::Forms::IWin32Window ^ owner);
public System.Windows.Forms.DialogResult Show (System.Windows.Forms.IWin32Window owner);
member this.Show : System.Windows.Forms.IWin32Window -> System.Windows.Forms.DialogResult
Public Function Show (owner As IWin32Window) As DialogResult

매개 변수

owner
IWin32Window

예외 메시지 상자의 부모 창입니다.

반환

사용자가 클릭한 단추의 DialogResult입니다.

예제

try
{
    // Do something that may generate an exception.
    throw new ApplicationException("An error has occured");
}
catch (ApplicationException ex)
{
    // Define a new top-level error message.
    string str = "The action failed.";

    // Add the new top-level message to the handled exception.
    ApplicationException exTop = new ApplicationException(str, ex);
    exTop.Source = this.Text;

    // Show an exception message box with an OK button (the default).
    ExceptionMessageBox box = new ExceptionMessageBox(exTop);
    box.Show(this);
}
Try
    ' Do something that may generate an exception.
    Throw New ApplicationException("An error has occured")
Catch ex As ApplicationException
    ' Define a new top-level error message.
    Dim str As String = "The action failed."

    ' Add the new top-level message to the handled exception.
    Dim exTop As ApplicationException = New ApplicationException(str, ex)
    exTop.Source = Me.Text

    ' Show an exception message box with an OK button (the default).
    Dim box As ExceptionMessageBox = New ExceptionMessageBox(exTop)
    box.Show(Me)
End Try

설명

이면 ButtonsCustomShow 항상 을 반환합니다.Cancel 사용자가 클릭한 단추를 확인하는 데 사용합니다 CustomDialogResult .

null 값을 제공Owner하면 Windows 작업 표시줄에 예외 메시지 상자가 나타납니다. 대신 부모 창 개체를 전달하는 것이 좋습니다.

적용 대상

Show(IntPtr, String, String, String, String, String, String, String)

예외 메시지 상자를 표시합니다. 정보를 제공하기 위해서만 확인됩니다. 지원 안 됨 향후 호환성은 보장되지 않습니다.

public:
 System::Windows::Forms::DialogResult Show(IntPtr hwnd, System::String ^ message, System::String ^ source, System::String ^ sourceAppName, System::String ^ sourceAppVersion, System::String ^ sourceModule, System::String ^ sourceMessageId, System::String ^ sourceLanguage);
public System.Windows.Forms.DialogResult Show (IntPtr hwnd, string message, string source, string sourceAppName, string sourceAppVersion, string sourceModule, string sourceMessageId, string sourceLanguage);
member this.Show : nativeint * string * string * string * string * string * string * string -> System.Windows.Forms.DialogResult
Public Function Show (hwnd As IntPtr, message As String, source As String, sourceAppName As String, sourceAppVersion As String, sourceModule As String, sourceMessageId As String, sourceLanguage As String) As DialogResult

매개 변수

hwnd
IntPtr

nativeint

부모 창에 대한 핸들인 System.IntPtr입니다.

message
String

이 인스턴스에 연결된 예외에 대한 메시지를 포함하는 문자열입니다.

source
String

이 인스턴스에 연결된 예외에 대한 원본을 포함하는 문자열입니다.

sourceAppName
String

원본 애플리케이션의 이름을 포함하는 문자열입니다.

sourceAppVersion
String

원본 애플리케이션 버전을 포함하는 문자열입니다.

sourceModule
String

원본 모듈 이름을 포함하는 문자열입니다.

sourceMessageId
String

원본 메시지 ID를 포함하는 문자열입니다.

sourceLanguage
String

원본 언어를 포함하는 문자열입니다.

반환

사용자가 클릭한 단추의 DialogResult입니다.

적용 대상