DocumentList.OnDocumentActivated メソッド
アセンブリ: Microsoft.WindowsCE.Forms (microsoft.windowsce.forms.dll 内)
構文
DocumentActivated イベントは、DocumentList コントロールでファイルが開かれたときに発生します。
イベントが発生すると、デリゲートを使用してイベント ハンドラが呼び出されます。詳細については、「イベントの発生」を参照してください。
OnDocumentActivated メソッドを使用すると、デリゲートを結び付けずに、派生クラスでイベントを処理することもできます。派生クラスでイベントを処理する場合は、この手法をお勧めします。
継承時の注意 派生クラスで OnDocumentActivated をオーバーライドする場合は、登録されているデリゲートがイベントを受け取ることができるように、基本クラスの OnDocumentActivated メソッドを必ず呼び出してください。DocumentActivated イベントを処理するメソッドのコード例を次に示します。このコード例は、DocumentList クラスのトピックで取り上げているコード例の一部分です。
' Handle the DocumentedActivated ' event with code to open the file. Private Sub DocList_DocumentActivated(ByVal sender As Object, _ ByVal docevent As Microsoft.WindowsCE.Forms.DocumentListEventArgs) Handles DocumentList1.DocumentActivated StatusBar1.Text = "Activated: " & docevent.Path ' Add code to open the selected file. End Sub
プラットフォーム
バージョン情報
参照
- DocumentList.OnDocumentActivated メソッドのページへのリンク