Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How should I write the code structure for "fileopendialog" to ListBox?

$
0
0

Previously, I able to add files based on "FileSelectFolder" to the listbox.

Now, I want to do the same thing but using "FileOpenDialog".

Any clue to do it?

AutoIt         
While 1     $msg = GUIGetMsg()     Select         Case $msg = $GUI_EVENT_CLOSE             Exit                     Case $msg = $btn_browsefiles              $tmp = FileOpenDialog("Choose files", @WindowsDir & "", "Excel files (*.xls;*.xlsx)", 1 + 4)             If Not @error Then           _GUICtrlListBox_ResetContent($hListBox)                 $ordner = $tmp                 $dateien = _FileListToArray($ordner, "*.xls*", 1)                 _GUICtrlListBox_BeginUpdate($hListBox)                 For $i = 1 To UBound($dateien) - 1                     ; Add file                     _GUICtrlListBox_AddString($hListBox, $dateien[$i])                 Next                 _GUICtrlListBox_UpdateHScroll($hListBox)         _GUICtrlListBox_EndUpdate($hListBox)         EndIf                 Next     Case $msg = $btn_browsefolder             $tmp = FileSelectFolder("Choose folder", "")             If Not @error Then                _GUICtrlListBox_ResetContent($hListBox)                 $ordner = $tmp                 $dateien = _FileListToArray($ordner, "*.xls*", 1)                 _GUICtrlListBox_BeginUpdate($hListBox)                 For $i = 1 To UBound($dateien) - 1                     ; Add file                     _GUICtrlListBox_AddString($hListBox, $dateien[$i])                 Next                 _GUICtrlListBox_UpdateHScroll($hListBox)                 _GUICtrlListBox_EndUpdate($hListBox)                  EndIf                                                                   Case $msg = $btn_clearlist                        $ordner=0                     _GUICtrlListBox_ResetContent($hListBox)                     _GUICtrlListBox_UpdateHScroll($hListBox)                             Case $msg = $btn_transfer                     ScanFolder($ordner)             EndSelect WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>