Что нового

Получить массив из ComboBox

Атос

Новичок
Сообщения
85
Репутация
0
Привет.

Как я могу получить массив, или коллекцию, или полный текстовый список всех элементов GUICtrlCreateCombo?


Код:
GUICreate(' ', 300, 400, -1, -1, 0x00CF0000)
Local $iCom = GUICtrlCreateCombo("", 150, 30, 100, 22, -1, 0x00000300)
GUICtrlSetData($iCom, 'AAA' & '|' & 'DDD' & '|' & 'ZZZ' )
Local $show = GUICtrlCreateButton("&Show", 200, 200, 60, 22)
GUISetState()
While 1
Switch GUIGetMsg()
Case -3
Exit
Case $show
MsgBox(0, "111", $iCom)
EndSwitch
WEnd
 

ra4o

AutoIT Гуру
Сообщения
1,165
Репутация
246
Вот так:
Код:
#include <array.au3>
#include <GuiComboBox.au3>

GUICreate(' ', 300, 400, -1, -1, 0x00CF0000)
Local $iCom = GUICtrlCreateCombo("", 150, 30, 100, 22, -1, 0x00000300)
GUICtrlSetData($iCom, 'AAA' & '|' & 'DDD' & '|' & 'ZZZ')
Local $show = GUICtrlCreateButton("&Show", 200, 200, 60, 22)
GUISetState()
While 1
	Switch GUIGetMsg()
		Case -3
			Exit
		Case $show
			$aList = _GUICtrlComboBox_GetListArray($iCom)
			_ArrayDisplay($aList)

	EndSwitch
WEnd
 
Верх