AppSoftwareVld,
Does this do what you want?
#include <GUIConstantsEx.au3>
; Array to hold input contents
Global $aContents[1] = [0]
; Set required string to match
$sRequired = "blue"
; Create GUI
$hGUI = GUICreate("Test", 500, 500)
$cInput = GUICtrlCreateInput("", 10, 10, 200, 20)
$cRead = GUICtrlCreateButton("Read", 10, 50, 80, 30)
$cShow = GUICtrlCreateButton("Show", 100, 50, 80, 30)
$cCombo = GUICtrlCreateCombo("", 10, 100, 200, 200)
GUICtrlSetState($cCombo, $GUI_HIDE)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $cRead
; Increase size of array
$aContents[0] += 1
ReDim $aContents[$aContents[0] + 1]
; Check if there is something to add
If GUICtrlRead($cInput) <> "" Then
; Add input contents to array
$aContents[$aContents[0]] = GUICtrlRead($cInput)
EndIf
; Clear input
GUICtrlSetData($cInput, "")
; Reset focus to input
GUICtrlSetState($cInput, $GUI_FOCUS)
Case $cShow
; Create new combo data
$sComboData = ""
;Loop through array
For $i = 1 To $aContents[0]
; Check if required value is present
If StringInStr($aContents[$i], $sRequired) Then
; And add to combo data
$sComboData &= "|" & $aContents[$i]
EndIf
Next
; Add data to combo
GUICtrlSetData($cCombo, $sComboData)
; Show combo
GUICtrlSetState($cCombo, $GUI_SHOW)
Case $cCombo
GUICtrlSetState($cCombo, $GUI_HIDE)
EndSwitch
WEnd
M23