Sub btn_FileList_Click
Dim fd As FileDialog
fd.FastScroll = True
fd.KeyboardPopUp = False
If File.IsDirectory(File.DirRootExternal, "Download") Then
fd.FilePath = File.DirRootExternal & "/Download/"
Else
Log("/Download/ is not a folder")
fd.FilePath = Starter.PathDrawings 'Change to Downloads
End If
fd.FileFilter = ".jpg,.bmp,.png,.JPG,.BMP,.PNG"
Dim ret As Int
ret = fd.Show("Choose a file to load:", "Okay", "Cancel", "", Null)
If ret = DialogResponse.CANCEL Or fd.ChosenName = "" Then
Return
Else If File.Exists(fd.filepath, fd.ChosenName) = False Then
Msgbox(fd.ChosenName & " does not exist.", "")
Else
'Restrict to 50 Characters
Dim myChosenName As String
If fd.ChosenName.Length > 54 Then
ToastMessageShow("Truncating Filename to 50 Characters",False)
myChosenName = Subs.Left(myChosenName,50) & "." & Subs.Right(myChosenName,3)
Else
myChosenName = fd.ChosenName
End If