Fredp123 Posted July 31, 2009 Share Posted July 31, 2009 Hi all,This is not my first script, but it is my first time posting. What is the easiest way to have the selection made in Combo #1 update the values in Combo #2 when Combo #2 is being populated from a _FileListToArray?Thanks!-Fred Link to comment Share on other sites More sharing options...
Developers Jos Posted July 31, 2009 Developers Share Posted July 31, 2009 Only update when the selection in ComboBox1 changes? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Fredp123 Posted July 31, 2009 Author Share Posted July 31, 2009 Only update when the selection in ComboBox1 changes?Yes. If there was something which value would change only when Combo 1 was changed that would be ideal. The constant polling of Combo 1 fails due to flicker. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 31, 2009 Developers Share Posted July 31, 2009 (edited) Yes. If there was something which value would change only when Combo 1 was changed that would be ideal. The constant polling of Combo 1 fails due to flicker.Maybe you need to show some code here, but I think it should work fine when you update the Combo2 only when Combo1 changes.Jos Edited July 31, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GEOSoft Posted July 31, 2009 Share Posted July 31, 2009 Some resolutions to flicker problems are here. http://www.autoitscript.com/forum/index.php?showtopic=94713&view=findpost&p=680434 In your case set a Variable to start and then check and update that variable before updating the 2nd combo. ; $sCheck = GUICtrlRead($Combo_1) ;; Then in your Message loop (While 1) use If GUICtrlRead($Combo_1) <> $sCheck Then GUICtrlSetData($Combo_2, "Whatever you want") $sCheck = GUICtrlRead($Combo_1) EndIf ; George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Fredp123 Posted July 31, 2009 Author Share Posted July 31, 2009 Thank you both very much!GEO, I thought of that logic, but couldn't put it into code. Here is what I just came up with that works: Case $Combo_State $Type=GUICtrlRead($Combo_State) ;MsgBox(0,"test",$Type) Switch $Type Case "TN" $GUIlist = _FileListToArray("\\server\TN\Cust. Contracts") $missing = _ArraySearch($GUIlist,"Missing Contracts") ; delete Missing Contracts Folder _ArrayDelete($GUIlist,$missing) GUICtrlSetData($hCombo,"") ; clears out previous values For $z = 1 to Ubound($GUIlist)-1 ; Populates the combo box GUICtrlSetData($hCombo,$GUIlist[$z]) Next Case "AL" $GUIlist = _FileListToArray("\\server\AL\Cust. Contracts") $missing = _ArraySearch($GUIlist,"Missing Contracts") ; delete Missing Contracts Folder _ArrayDelete($GUIlist,$missing) GUICtrlSetData($hCombo,"") ; clears out previous values For $z = 1 to Ubound($GUIlist)-1 ; Populates the combo box GUICtrlSetData($hCombo,$GUIlist[$z]) Next EndSwitch Link to comment Share on other sites More sharing options...
Developers Jos Posted July 31, 2009 Developers Share Posted July 31, 2009 (edited) Try this logic to see if thats faster. $temp = "|" $GUIlist = _FileListToArray("\\server\TN\Cust. Contracts") For $x = 1 To $GUIlist[0] If $GUIlist[$x] <> "Missing Contracts" Then $temp &= "|" & $GUIlist[$x] Next GUICtrlSetData($hCombo,$temp) Edited July 31, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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