ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #1 Hi I wonder how to detect cancel click in filechooser? I tried this B4X: Dim fc As FileChooser fc.Initialize Dim filename As String = fc.ShowOpen(MainForm) If fc = fx.DialogResponse.CANCEL Then ' code End If Thanks, ThRuST
Hi I wonder how to detect cancel click in filechooser? I tried this B4X: Dim fc As FileChooser fc.Initialize Dim filename As String = fc.ShowOpen(MainForm) If fc = fx.DialogResponse.CANCEL Then ' code End If Thanks, ThRuST
EnriqueGonzalez Expert Licensed User Longtime User Jun 8, 2017 #2 filechooser will return an empty string wheter it was cancelled or the user did not choose any file. Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #3 Nice answer. Now why didn't I think of this myself Thanks Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #4 And for all the lamers out there that is new to programming here's the solution B4X: Dim fc As FileChooser fc.Initialize Dim filename As String = fc.ShowOpen(MainForm) If filename = "" Then ' No file choosen Else ' User choosed a filename End If Upvote 0
And for all the lamers out there that is new to programming here's the solution B4X: Dim fc As FileChooser fc.Initialize Dim filename As String = fc.ShowOpen(MainForm) If filename = "" Then ' No file choosen Else ' User choosed a filename End If
EnriqueGonzalez Expert Licensed User Longtime User Jun 8, 2017 #5 That happens, its normal for us to overcomplicated ourselves, watch out when you copy paste from the forums tags, they will mess the formatting, look at your 2nd line! Upvote 0
That happens, its normal for us to overcomplicated ourselves, watch out when you copy paste from the forums tags, they will mess the formatting, look at your 2nd line!
ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #6 I corrected it before you refreshed the page, but thanks for helping me changing the world Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #7 Btw how to change the default extension and path? (Please do not start a new question for this follow-up questions) Upvote 0
Btw how to change the default extension and path? (Please do not start a new question for this follow-up questions)
ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #8 Enrriqueee, pleeaassee Amiiigo, hurryy to answerrr myy quesstion. Coding caanoottt waitt Upvote 0
EnriqueGonzalez Expert Licensed User Longtime User Jun 8, 2017 #9 i am sorry!! this is how. B4X: fc.Title="Select Photo" fc.InitialDirectory = "C:\Proyectos" fc.SetExtensionFilter("Image",Array As String("*.jpg","*.png","*.bmp")) Upvote 0
i am sorry!! this is how. B4X: fc.Title="Select Photo" fc.InitialDirectory = "C:\Proyectos" fc.SetExtensionFilter("Image",Array As String("*.jpg","*.png","*.bmp"))
ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #10 Stole this code from Fabrice La B4X: fc.InitialFileName = "excelfile.xls" fc.SetExtensionFilter("Excel Files",Array As String("*.xls")) Upvote 0
Stole this code from Fabrice La B4X: fc.InitialFileName = "excelfile.xls" fc.SetExtensionFilter("Excel Files",Array As String("*.xls"))
ThRuST Well-Known Member Licensed User Longtime User Jun 8, 2017 #12 Great, Thank you very much Amiga (EDIT:Amigo) my friend. BRAVOISSIMMO!!! Upvote 0