#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 515, 279, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Event")
$ListView1 = GUICtrlCreateListView("A|B|C", 48, 24, 169, 193)
$item1 = GUICtrlCreateListViewItem("项1|子项1|123", $ListView1)
GUICtrlSetOnEvent($item1, "Event")
$item3 = GUICtrlCreateListViewItem("项2|子项2|456", $ListView1)
GUICtrlSetOnEvent($item3, "Event")
$item4 = GUICtrlCreateListViewItem("项3|子项3|789", $ListView1)
GUICtrlSetOnEvent(-1, "Event")
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 50)
$Combo1 = GUICtrlCreateCombo("", 248, 80, 225, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Event()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case Else
$Val = GUICtrlRead(@GUI_CtrlId, 1)
$Val = StringSplit($Val, "|", 1)
MsgBox("", $Val[1], $Val[2])
GUICtrlSetData($Combo1, $Val[3], $Val[3])
EndSwitch
EndFunc ;==>Event
|