fred666777 Posted November 3, 2009 Share Posted November 3, 2009 i dont know how i would start...or search this.how would i make the drop down a list of .ini files saved in a certain directory.ini files would constantly be being added/removed after each use of the program not while it is running.i dont know if i explained well enoughfiles in folder-file1.ini-file2.ini-file3.inicomboboxblank on startwhen click down|combobox \/||file1.ini ||file2.ini | |file3.ini | Link to comment Share on other sites More sharing options...
omikron48 Posted November 3, 2009 Share Posted November 3, 2009 (edited) Use FileFindFirstFile and FileFindNextFile to get the .ini files in the folder, then just append them all together to generate the input parameter for the combobox. You can also use _FileListToArray to dump the filenames into an array then proceed from there. Edited November 3, 2009 by omikron48 Link to comment Share on other sites More sharing options...
Thamiel Posted November 3, 2009 Share Posted November 3, 2009 From the help file, did change _GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe") to _GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.ini") #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <Constants.au3> Opt('MustDeclareVars', 1) $Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work _Main() Func _Main() Local $hCombo ; Create GUI GUICreate("ComboBox Add Dir", 400, 296) $hCombo = GUICtrlCreateCombo("", 2, 2, 396, 296) GUISetState() ; Add files _GUICtrlComboBox_BeginUpdate($hCombo) _GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.ini") _GUICtrlComboBox_EndUpdate($hCombo) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Link to comment Share on other sites More sharing options...
fred666777 Posted November 4, 2009 Author Share Posted November 4, 2009 that works but do you know how i would get rid of the .ini on the end of them? i've looked through _GUICtrlComboBox in the help file but cant find anything Link to comment Share on other sites More sharing options...
Manjish Posted November 4, 2009 Share Posted November 4, 2009 Do a stringsplit() with "." as the seperator. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now