boogieoompa Posted March 28, 2006 Posted March 28, 2006 Does anybody know how to display an array in a combo box I figured this would work (I also tried referencing the function by $ComboBox) but it was a no go. Any help wpuld be great, Thanks Dim $Combobox[10] $ComboBox[0] = "test 1" $ComboBox[1] = "test 2" GuiCtrlCreatecombo("Test1", 10, 100, 130, 100) GUICtrlSetData(-1,$ComboBox,"Test1")
Moderators SmOke_N Posted March 28, 2006 Moderators Posted March 28, 2006 Dim $MyArray[3] $MyArray[1] = 'Light' $MyArray[2] = 'Bulb' $Main = GUICreate('Main', 200, 100) $Combo = GUICtrlCreateCombo('', 10, 10, 180, 100) $Button = GUICtrlCreateButton('Populate Combo', 50, 40, 100, 30) GUISetState() While 1 $MSG = GUIGetMsg() If $MSG = - 3 Then Exit If $MSG = $Button Then GUICtrlSetData($Combo, PopulateComboArray($MyArray)) EndIf WEnd Func PopulateComboArray($nArray) Local $ReturnComboValue = '' For $i = 1 To UBound($nArray) - 1 $ReturnComboValue = $ReturnComboValue & $nArray[$i] & '|' Next Return StringTrimRight($ReturnComboValue, 1) EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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