次の方法で共有


DocumentListEventArgs.Path プロパティ

[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。]

DocumentList コントロールで削除または選択されたファイルへのパスを取得または設定します。

名前空間:  Microsoft.WindowsCE.Forms
アセンブリ:  Microsoft.WindowsCE.Forms (Microsoft.WindowsCE.Forms.dll 内)

構文

'宣言
Public ReadOnly Property Path As String
    Get
'使用
Dim instance As DocumentListEventArgs
Dim value As String

value = instance.Path
public string Path { get; }
public:
property String^ Path {
    String^ get ();
}
member Path : string

プロパティ値

型 : System.String
ファイルへのパス。既定値は、空の文字列 ("") です。

解説

このプロパティを使用すると、DeletingDocument イベントへの応答として、開いているファイルのインスタンスを閉じることができます。また、DocumentActivated イベントへの応答として、ファイルを開く際にも使用できます。

DeletingDocument イベントを処理するメソッドを定義するコード例を次に示します。この例では、Path の DocumentListEventArgs プロパティを使用して、削除されたファイルへのパスを取得しています。このコード例は、DocumentList クラスのトピックで取り上げているコード例の一部分です。

' Handle the DeletingDocument ' event with code to close the file.PrivateSub DocList_DeletingDocument(ByVal sender AsObject, _
 ByVal docevent As Microsoft.WindowsCE.Forms.DocumentListEventArgs) _
 Handles DocumentList1.DeletingDocument

     StatusBar1.Text = "Deleted: " & docevent.Path
     ' Add code to close any instances of the file.EndSub
privatevoid OnDelDoc(object obj, DocumentListEventArgs docg)
{
    statusBar1.Text += "Deleted: " + docg.Path;

    // Add code to close any instances of the file.
}

.NET Framework セキュリティ

プラットフォーム

Windows Mobile for Pocket PC

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。 サポートされているバージョンについては、「.NET フレームワークのシステム要件」を参照してください。

バージョン情報

.NET Compact Framework

サポート対象 : 3.5、2.0

参照

参照

DocumentListEventArgs クラス

DocumentListEventArgs メンバー

Microsoft.WindowsCE.Forms 名前空間