FileDialog (how to use)

Mahares

Expert
Licensed User
Longtime User
Here it is:
B4X:
Dim MyFile as string
Sub Button6099_Click
'------------------------------------------------
    Dim fd As FileDialog 
        
     fd.FastScroll = True
     fd.FilePath = File.Combine(File.DirRootExternal, "/Saved/PDTK/Pics/")
     fd.FileFilter = ".jpg"      
 
    fd.Show("Select receipt picture to associate this expense to.", "Okay", "Cancel", "", Null) 
    MyFile=fd.ChosenName  ''will return the file name you select
End Sub
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Did you try something like this. I did not have a full chance to test:
B4X:
'bring up file dialog
    fd.Show("Select picture to associate to.", "Associate", "Cancel", "", Null) 
    ExpPic = fd.ChosenName  'will return the file name you select
   if ExpPic="" then
   msgbox("Must Select a file from the list.","")
   Button6099_Click
  end if
 
Upvote 0
Top