Open File Dialog (PRIM_APPL.ICommonDialogFileOpen)

Windows File Open dialog

Ancestors - None

Details

The Windows File Open Dialog is used for selecting a file to open.
 
This feature uses Windows functionality. Precise implementation will depend on the Windows version.

Example

Using the file open Dialog to select a file.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM *implements #Prim_App.iHelpHandler) Theme(#SYS_THEME<2015Blue>) Clientwidth(551) Clientheight(301) Left(165) Top(204) Width(567)
 
   Define_Com Class(#PRIM_PHBN) Name(#Pick) Caption('Pick a File') Displayposition(1) Left(16) Parent(#COM_OWNER) Tabposition(1) Top(16) Width(129)
 
   Evtroutine Handling(#Pick.Click)
 
      #Com_owner.PickaFile
 
   Endroutine
 
   Mthroutine Name(PickaFile)
 
      Define_Com Class(#Prim_appl.ICommonDialogFileOpen) Name(#FileOpen) Reference(*Dynamic)
 
      #FileOpen <= #sys_appln.CreateFileOpenDialog
 
      If (#FileOpen.Show)
 
         #Com_owner.Caption := #FileOpen.FileTitle
 
      Endif
 
   Endroutine
 
End_Com

Properties

NameDescription
DefExtensionDefault file extension
ExplorerStyleMake the dialog appear like Windows Explorer
FileThe currently selected file
FileCountNumber of selected files
FilesCollection of all selected file names
FileTitleCaption to appear in the title bar
FilterCaptionCaption of the specified filter
FilterCountTotal number of filters
FilterExtensionCollection of all all filter extensions
FilterIndexIndex of the currently selected filter
HideReadOnlyShow or hide the ReadOnly property
InitialDirInitial folder to be shown in the dialog
MultiSelectAllow multiple files to be selected
TitleCaption to show at in the title bar

Methods

NameDescription
AddFilterAdd a file type filter
Name, Extention
ShowShow as a modal dialog
FormOwner, OKPressed

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2