Displays the Open dialog box.
[ enRetVal = ] Object.ShowOpen()
The ShowOpen method syntax has the following parts:
Name |
Type |
Description |
Object |
An Object |
An object |
enRetVal |
Val enumACommonDialogRetVal |
An integer specifying the status of the dialog box. |
enumACommonDialogRetVal can be one of the following:
Name |
Value |
Description |
acdlgRetValOk |
0x00000000 |
OK |
acdlgRetValCancel |
0x00000001 |
Cancel |
acdlgRetValError |
0x00000002 |
Error |
After initializing the dialog box’s properties, call the ShowOpen method to display the dialog box and allow the user to enter the path and file.
The following example will display the Open dialog box:
cdlg.InitDir="c:\\MyDir"
cdlg.Filter=Program Files (*.PRG)|*.PRG
cdlg.OpenOptions=acdlgOpenOptionsExlorer OR acdlgOpenOptionsNoChangeDir
if (cdlg.ShowOpen() = acdlgRetValOk)
if (FileHandle=FileOpen(cdlg.FileName))
FileRead(FileHandle, ....)