DocumentList-Klasse

Dieser Dokumentation für die Vorschau nur ist und in späteren Versionen geändert. Leere Themen wurden als Platzhalter eingefügt.]

Stellt ein Pocket PC-Steuerelement zum Anzeigen und Verwalten von Dokumenten in konsistenter Weise dar.

Namespace:  Microsoft.WindowsCE.Forms
Assembly:  Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)

Syntax

'Declaration
Public Class DocumentList _
    Inherits Control
'Usage
Dim instance As DocumentList
public class DocumentList : Control
public ref class DocumentList : public Control
type DocumentList =  
    class
        inherit Control
    end

Hinweise

Ein Steuerelement DocumentList stellt eine verwaltete Implementierung der das systemeigene Windows CE DocList-Steuerelement, das Steuerelement, sichtbar ist, z. B. beim Starten von Microsoft ® Pocket Word und Microsoft ® Pocket Excel.Dieses Steuerelement stellt die folgende Funktionen bereit:

  • Auswählen, löschen, kopieren, verschieben und Umbenennen von Dateien und Ordnern.

  • Sortieren nach Dateiname, Datum oder Größe.

  • E-Mail-Dateien.

  • Senden Sie Dateien von Infrarot an ein anderes Gerät.

Ein DocumentList ist ein Steuerelement statt einer gesamten Dialogfeld wie z. B. FileDialog.Ein Steuerelement DocumentList können Sie benutzerdefinierte Menüs oder andere Steuerelemente in Ihren Dateien Auswahlelements einschließen.

Ein DocumentList müsste die gleiche Breite wie das Formular in der es abgelegt wird.Die Länge kann solange erforderlich sein.

Ein DocumentList zeigt nur die Dateien eines ausgewählten Ordners in der Hierarchie Eigene Dateien.

Topic Location
Gewusst wie: Verwenden eines DocumentList-Steuerelements .NET Compact Framework
Gewusst wie: Verwenden eines DocumentList-Steuerelements .NET Compact Framework
Gewusst wie: Verwenden eines DocumentList-Steuerelements .NET Compact Framework
SO WIRD'S GEMACHT: Verwenden eines DocumentList-Steuerelements dv_fxnetcf

Beispiele

Im folgenden Codebeispiel wird ein enthaltenes in einer DocumentListPanel Steuerelement erstellt.

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());
    }
}

Vererbungshierarchie

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

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic)-Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Plattformen

Windows Mobile für Pocket PC

Die .NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET framework.

Versionsinformationen

.NET Compact Framework

Unterstützt in: 3.5, 2.0

Siehe auch

Referenz

Member DocumentList

Microsoft.WindowsCE.Forms-Namespace

Weitere Ressourcen

SO WIRD'S GEMACHT: Verwenden eines DocumentList-Steuerelements