DocumentList.Filter Property
Gets or sets a file filtering specification.
Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)
Syntax
'Declaration
Public Property Filter As String
'Usage
Dim instance As DocumentList
Dim value As String
value = instance.Filter
instance.Filter = value
public string Filter { get; set; }
public:
property String^ Filter {
String^ get ();
void set (String^ value);
}
/** @property */
public String get_Filter ()
/** @property */
public void set_Filter (String value)
public function get Filter () : String
public function set Filter (value : String)
Property Value
The currently specified file filters.
Exceptions
Exception type | Condition |
---|---|
The filtering specification is invalid. |
Remarks
For each filtering option, the filter string contains a description of the filter, followed by a vertical bar (|) and the filter pattern. Because of limited space, Pocket PC guidelines suggest skipping the description. An omitted description requires a space before a vertical bar.
For example, the following filter string includes a description:
"Text files (*.txt)|*.txt"
Without a description, this filter string should appear as:
" |*.txt"
A vertical bar also separates filtering options. You can use semicolons to delineate multiple filter patterns within a filter option. The following filter string specifies five filtering options:
" |*.*| |*.pwi;*.pdt| |*.rtf| |*.txt| |*.xml"
Use the FilterIndex property to specify which filtering option the user is shown first. The FilterIndex is zero-based. Using the filter string just described, the index values are as follows:
Index value |
Filter pattern |
---|---|
0 |
*.* |
1 |
*.pwi;*.pdt |
2 |
*.rtf |
3 |
*.txt |
4 |
*.xml |
Example
The following code example sets the Filter property. This code example is part of a larger example provided for the DocumentList class.
.Filter = " |*.*| |*.txt;*.xml| |*.pwi;*.pdt| |*.pxl;*.psw| |*.jpg;*.gif;*.bmp| |*.wav;*.wmv;*.mpg;"
DocList.Filter = " |*.*| |*.txt;*.xml| |*.pwi;*.pdt| " +
"|*.pxl;*.psw| |*.jpg;*.gif;*.bmp| |*.wav;*.wmv;*.mpg;";
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .
Platforms
Windows Mobile for Pocket PC
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Version Information
.NET Compact Framework
Supported in: 2.0
See Also
Reference
DocumentList Class
DocumentList Members
Microsoft.WindowsCE.Forms Namespace