SetImageFilters
Replaces the Filter with pairs for image files.
Syntax: object.SetImageFilters
- object
- required An object expression that evaluates to a cDialog.
Remarks
SetImageFilters calls ClearFilter, so any earlier filter is lost, and then AddFilter for each pair:
| Description | Pattern |
|---|---|
Bitmap Files (*.bmp) | *.bmp |
JPEG Files (*.jpg;*.jpeg) | *.jpg;*.jpeg |
PNG Files (*.png) | *.png |
GIF Files (*.gif) | *.gif |
All Image Files (*.bmp;*.jpg;*.jpeg;*.png;*.gif) | *.bmp;*.jpg;*.jpeg;*.png;*.gif |
All Files (*.*) | *.* |
The descriptions are fixed English text. To show other text, build the filter with AddFilter. The file-type list of the dialog holds the six descriptions in this order. The first, Bitmap Files, is the one that is selected when the dialog opens, not All Image Files, which is the fifth.
Example
Dim dlg As New cDialog
Dim parts() As String
Dim pairCount As Long
dlg.AddFilter "Old", "*.old"
dlg.SetImageFilters
parts = Split(dlg.Filter, "|")
pairCount = (UBound(parts) + 1) \ 2
Debug.Print pairCount ' 6
Debug.Print parts(0) ' Bitmap Files (*.bmp)
Debug.Print parts(1) ' *.bmp
See Also
- SetCommonFilters method – text files
- SetDocumentFilters method – office documents
- SetCodeFilters method – source code files
- Filter property – the whole list as one string
- cDialog class – overview