Filter Property
Syntax
CWIMAQImageDialog.Filter
Data Type
Purpose
The filters that are displayed in the type list box of a dialog box.
Remarks
Use the pipe ( | ) symbol (ASCII 124) to separate the description and filter values. Do not include spaces before or after the pipe symbol, because these spaces will be displayed with the description and filter values.
The following code shows an example of a filter that enables the user to select bitmap files or JPEG files.
Bitmaps (*.bmp)|*.bmp|JPEGs (*.jpg)|*.jpg
When you specify more than one filter for a dialog box, use the FilterIndex property to determine which filter is displayed as the default.
Example
Dim ImageDialog As New CWIMAQImageDialog ImageDialog.DialogTitle = "Select a file" ImageDialog.Filter = "All files (*.*)|*|All image types (*.bmp;*.tif;*.png;*.jpg;*.apd)|*.bmp;*.tif;*.png;*.jpg;*.apd|Bitmaps (*.bmp)|*.bmp|TIFF files (*.tif)|*.tif|PNG files (*.png)|*.png|JPEG files (*.jpg)|*.jpg|AIPD files (*.apd)|*.apd||" ImageDialog.FilterIndex = 2 ImageDialog.ShowOpen MsgBox "The file you selected is: " & ImageDialog.FileName