Click or drag to resize

StandardFileDialog.SetFilter Method

X#
Set single or multiple filters and descriptions for the standard dialogs. If multiple filters are specified, a filter index may also be specified.

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD SetFilter(
	uFilter,
	uFilterDesc,
	nIndex
) AS USUAL CLIPPER
Request Example View Source

Parameters

uFilter (Optional)
Type: Usual
An array of filter strings. Grouped filters within a string must be delimited by semicolons or a single filter string. Grouped filters within a string must be delimited by semicolons..
uFilterDesc (Optional)
Type: Usual
An array of filter descriptions.
nIndex (Optional)
Type: Usual
A number specifying the initial filter in use if multiple filters are in effect.

Return Value

Type: Usual
Remarks
The standard dialog windows for the OpenFile and SaveAs dialogs may be customized by specifying one or more file name filters and their descriptions. The filters are used as a mask for file names displayed in the list. Each filter string may be composed of several filters delimited by semicolons. If multiple filters have been set, an index may be specified, which in turn specifies the initial filter displayed.
Tip Tip
In the above example, the second parameter to the class has been specified as "" because without this the filter will have no effect and the default of "*.*" will take effect so as to show all files.
Examples
This example sets multiple filters for an OpenFile dialog. Some of the filter strings specify groups of filters:
X#
 1METHOD MyOpen() CLASS StandardShellWindow
 2LOCAL oOpenDialog AS OpenDialog
 3oOpenDialog:= OpenDialog{SELF, ""}
 4oOpenDialog:Caption:="Multiple Filters Test"
 5oOpenDialog:SetFilter (    {"*.WRI;*.TXT", "*.PRG;*.CXX;*.C", "*.INI"},;
 6{"Doc", "Program Source", "INI Files"},2)
 7// The index may also be set independently:
 8// oOpenDialog:SetFilter(,,2)
 9oOpenDialog:InitialDirectory := "C:\CAVO28\Bin\"
10oOpenDialog:Show()
See Also