Macro Scheduler v14

File Browse Buttons

Button objects can invoke standard file Open and Save dialogs as well as the Folder Browse dialog.  The following properties exist:

 

BrowseStyle

Filename

InitialDir

Filter

DoBrowse

 

BrowseStyle can take one of the following values to make the button initiate one of the following dialog types:

 

fbOpen: File Open Dialog

fbSave: File Save Dialog:

fbFolder: File Browse Dialog

 

InitialDir should be used to set the initial folder for the dialog, and Filter the file spec filter (e.g. *.txt).  Filename can both be set with an initial filename and also is used to get the filename chosen by the user.

 

Setting DoBrowse to True invokes the browse operation.

 

E.g.  The following code causes the DoBrowse subroutine to be executed when the user clicks a button.  Inside DoBrowse we then invoke the button's file browse dialog.

 

//Set an Event Handler for the button's OnClick event

AddDialogHandler>Dialog1,btnBrowse,OnClick,DoBrowse

 

 

//Here we perform the file browse, then get the filename and output it to an edit box

SRT>DoBrowse

 SetDialogProperty>Dialog1,btnBrowse,DoBrowse,True

 GetDialogProperty>Dialog1,btnBrowse,Filename,str_Filename

 SetDialogProperty>Dialog1,txtFilename,Text,str_Filename

END>DoBrowse