Share via


DocumentList クラス

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

一貫性のある方法で、文書を表示および管理する Pocket PC コントロールを表します。

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

構文

'宣言
Public Class DocumentList _
    Inherits Control
'使用
Dim instance As DocumentList
public class DocumentList : Control
public ref class DocumentList : public Control
type DocumentList =  
    class
        inherit Control
    end

解説

DocumentList コントロールは、ネイティブ Windows CE DocList コントロールのマネージ実装を提供します。DocList コントロールは、たとえば、Microsoft® Pocket Word や Microsoft® Pocket Excel を起動すると表示されます。このコントロールには、次の機能が用意されています。

  • ファイルおよびフォルダーの選択、削除、コピー、移動、および名前の変更を行います。

  • ファイル名、日付、またはサイズ順に並べ替えます。

  • ファイルを電子メールで送信します。

  • 赤外線によって別のデバイスにファイルを送信します。

DocumentList は、FileDialog のようにダイアログ ボックス全体ではなく、1 つのコントロールです。DocumentList コントロールを使用すると、ファイルを選択する UI にカスタム メニューや他のコントロールを含めることができます。

DocumentList は、これを配置するフォームと同じ幅にする必要があります。長さは必要な長さに設定できます。

DocumentList は、マイ ドキュメントの階層にある選択したフォルダーのファイルだけを表示します。

Topic Location
方法 : DocumentList コントロールを使用する .NET Compact Framework
方法 : DocumentList コントロールを使用する .NET Compact Framework
方法 : DocumentList コントロールを使用する .NET Compact Framework
方法 : DocumentList コントロールを使用します。 dv_fxnetcf

DocumentList に含める Panel コントロールを作成するコード例を次に示します。

Imports System
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Imports Microsoft.WindowsCE.Forms


PublicClass Form1
   Inherits System.Windows.Forms.Form
    FriendWithEvents StatusBar1 As System.Windows.Forms.StatusBar
    FriendWithEvents DocumentList1 As Microsoft.WindowsCE.Forms.DocumentList

  PublicSharedSub Main()
    Application.Run(New Form1)
 EndSubPublicSubNew()

      InitializeComponent()
      Me.MinimizeBox = false
      Me.DocumentList1 = New DocumentList

   'Set up file extension filters for a   'DocumentList and set the initial folder   'to the Busines folder under My Documents.With DocumentList1
      .Parent = Me
      .Filter = " |*.*| |*.txt;*.xml| |*.pwi;*.pdt| |*.pxl;*.psw| |*.jpg;*.gif;*.bmp| |*.wav;*.wmv;*.mpg;"
      .FilterIndex = 0
      .SelectedDirectory = "Business"EndWithEndSubProtectedOverridesSub Dispose(disposing AsBoolean)
      MyBase.Dispose(disposing)
   EndSubPrivateSub InitializeComponent()
      Me.SuspendLayout()
        Me.StatusBar1 = New System.Windows.Forms.StatusBar
        '        'StatusBar1        'Me.StatusBar1.Location = New System.Drawing.Point(0,248)
        Me.StatusBar1.Size = New System.Drawing.Size(240,22)
        '       'Me.Controls.Add(Me.StatusBar1)
      Me.Text = "DocList Demo"Me.ResumeLayout(False)
   EndSub
  ' 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
   ' Handle the DocumentedActivated      ' event with code to open the file.PrivateSub DocList_DocumentActivated(ByVal sender AsObject, _
    ByVal docevent As Microsoft.WindowsCE.Forms.DocumentListEventArgs) Handles DocumentList1.DocumentActivated

        StatusBar1.Text = "Activated: " & docevent.Path
     ' Add code to open the selected file.EndSub
    ' Handle the SelectedDirectoryChanged    ' event with code that sets the correct      ' path for opening and closing files.PrivateSub DocList_SelectedDirectoryChanged(ByVal sender AsObject, _
    ByVal e As System.EventArgs) Handles DocumentList1.SelectedDirectoryChanged

        StatusBar1.Text = "Folder: " & DocumentList1.SelectedDirectory
        ' Add code to access the selected folder to open and close files.    EndSubEndClass
using System;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms;

publicclass Form1 : Form
{
    private DocumentList DocList;
    private StatusBar statusBar1;

    public Form1()
    {
        // Create an instance of a DocumentList control.
        DocList = new DocumentList();

        // Create an instance of the event handler delegate// using a reference to the OnDocActivated method,// which handles the DocumentActivated event.// Add the delegate instance to the DocumentActivated event.
        DocList.DocumentActivated +=
           new DocumentListEventHandler(this.OnDocActivated);

        // Create an instance of the event handler delegate// using a reference to the OnFolderSel method,// which handles the SelectedDirectoryChanged event.// Add the delegate instance to the// SelectedDirectoryChanged event.
        DocList.SelectedDirectoryChanged +=
           new EventHandler(this.OnFolderSel);

        // Create an instance of the event handler delegate// using a reference to the OnDelDoc method,// which handles the DeletingDocument event.// Add the delegate instance to the// DeletingDocument event.
        DocList.DeletingDocument +=
           new DocumentListEventHandler(this.OnDelDoc);

        DocList.Filter = " |*.*| |*.txt;*.xml| |*.pwi;*.pdt| " +
           "|*.pxl;*.psw| |*.jpg;*.gif;*.bmp| |*.wav;*.wmv;*.mpg;";
        DocList.FilterIndex = 0;
        DocList.SelectedDirectory = "Personal";

        statusBar1 = new StatusBar();
        statusBar1.Parent = this;
        DocList.Parent = this;
        this.Text = "DocList Demo";

        // Display the OK button for closing the application.this.MinimizeBox = false;
    }
    privatevoid OnDelDoc(object obj, DocumentListEventArgs docg)
    {
        statusBar1.Text += "Deleted: " + docg.Path;

        // Add code to close any instances of the file.
    }
    privatevoid OnDocActivated(object obj, DocumentListEventArgs docg)
    {
        statusBar1.Text = "Activated: " + docg.Path;

        // Add code to open the selected file.
    }
    privatevoid OnFolderSel(object obj, EventArgs eventg)
    {
        statusBar1.Text = "Folder: " + DocList.SelectedDirectory;

        // Add code to access the selected folder to open and close files.
    }
    staticvoid Main()
    {
        Application.Run(new Form1());
    }
}

継承階層

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Windows.Forms.Control
        Microsoft.WindowsCE.Forms.DocumentList

スレッド セーフ

この型のすべてのパブリック static (Visual Basic では Shared) メンバーは、スレッド セーフです。 インスタンス メンバーの場合は、スレッド セーフであるとは限りません。

プラットフォーム

Windows Mobile for Pocket PC

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

バージョン情報

.NET Compact Framework

サポート対象 : 3.5、2.0

参照

参照

DocumentList メンバー

Microsoft.WindowsCE.Forms 名前空間

その他の技術情報

方法 : DocumentList コントロールを使用します。