次の方法で共有


ErrObject.Description プロパティ

定義

エラーに関連付けられた説明文字列を含む String 式を設定または返します。 読み取りと書き込みが可能です。

public:
 property System::String ^ Description { System::String ^ get(); void set(System::String ^ value); };
public string Description { get; set; }
member this.Description : string with get, set
Public Property Description As String

プロパティ値

エラーに関連付けられた説明文字列を含む String 式を設定または返します。 読み取りと書き込みが可能です。

次の使用例は、Err オブジェクトのDescription プロパティにユーザー定義メッセージを割り当てます。

On Error Resume Next
Err.Raise(60000)
Err.Description = "Your Widget needs a new Frob!"
MsgBox(Err.Description)

注釈

Descriptionプロパティの設定は、エラーの簡単な説明で構成されます。 このプロパティを使用して、処理できない、または処理したくないエラーをユーザーに警告します。 ユーザー定義エラーを生成する場合は、エラーの簡単な説明を Description プロパティに割り当てます。 Description プロパティが入力されておらず、Number プロパティの値が Visual Basic ランタイム エラーに対応する場合、ErrorToString関数によって返される文字列は、エラーの生成時に Description プロパティに設定されます。

適用対象

こちらもご覧ください