Microsoft Common Dialog Control
Revision as of 20:02, 18 April 2008 by Woozle (talk | contribs) (New page: ==Overview== The Microsoft Common Dialog Control, shown as MSComDlg in an ActiveX browser, provides an API for many of the standard dialog boxes used in [[Microsoft Win...)
Overview
The Microsoft Common Dialog Control, shown as MSComDlg in an ActiveX browser, provides an API for many of the standard dialog boxes used in Microsoft Windows.
It is, however, not very well documented, and the ActiveX interface does not display the names of some of the crucial identifiers.
Usage
When you create a control of this type, the actual properties and methods are accessed via "ControlName.Object.MemberName".
Properties
- .Filter: a delimited text string which specifies the filename filters to apply when displaying the file listing. The format is semicolons.
- .FileName: returns the name(s) of the file(s) selected. If a single file was selected, it returns the filespec. If multiple files were selected, then it is a demarcated list within a single string; items are separated by a null character (Chr(0)):
- The first item is the full path to the directory occupied by the selected files
- Each subsequent item is a filename only, no path
Formats
.Filter
description|mask[|description|mask...]"
- Mask can be either a single wildcarded filemask (as used in DOS directory listings) or a list of masks separated by semicolons.
Examples
<vb> Me.axCmnDlg.Object.Filter = "All Files (*.*)|*.*|Web Image Files (png/jpg/gif)|*.png;*.jpg;*.jpeg;*.gif" </vb>