Open File Dialog (PRIM_APPL.ICommonDialogFileOpen)

Windows File Open dialog

Ancestors - None


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.


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)
   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


Name Description
DefExtension Default file extension
ExplorerStyle Make the dialog appear like Windows Explorer
File The currently selected file
FileCount Number of selected files
Files Collection of all selected file names
FileTitle Caption to appear in the title bar
FilterCaption Caption of the specified filter
FilterCount Total number of filters
FilterExtension Collection of all all filter extensions
FilterIndex Index of the currently selected filter
HideReadOnly Show or hide the ReadOnly property
InitialDir Initial folder to be shown in the dialog
MultiSelect Allow multiple files to be selected
Title Caption to show at in the title bar


Name Description
AddFilter Add a file type filter
Name, Extention
Show Show as a modal dialog
FormOwner, OKPressed

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020