#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
Opt("GUIOnEventMode", 1)
#region ### START Koda GUI section ### Form=
Dim $arr1[15]
$Form1 = GUICreate("Form1", 808, 173, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$ListView1 = GUICtrlCreateListView("杆型|名称|型号|单位|数量", 24, 8, 313, 145, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_FULLROWSELECT))
$arr1[0]=GUICtrlCreateListViewItem("D,DY1-2|横担|∠63×6×1400|根|2", $ListView1)
$arr1[1]=GUICtrlCreateListViewItem("D,DY1-2|六角螺栓|M16×300|付|4", $ListView1)
$arr1[2]=GUICtrlCreateListViewItem("D,DY1-2|六角螺栓|M16×250|付|4", $ListView1)
$arr1[3]=GUICtrlCreateListViewItem("D,DY1-2|弧形垫座|3#,1#|付|2", $ListView1)
$arr1[4]=GUICtrlCreateListViewItem("D,DY1-2|蝶式绝缘子|ED|只|8", $ListView1)
$arr1[5]=GUICtrlCreateListViewItem("D,DY1-2|六角螺栓|M16×150|付|8", $ListView1)
$arr1[6]=GUICtrlCreateListViewItem("D,DY1-2|垫片|φ17.5|个|28", $ListView1)
$arr1[7]=GUICtrlCreateListViewItem("DKD|横担|∠63×6×1400|根|2", $ListView1)
$arr1[8]=GUICtrlCreateListViewItem("DKD|弧形垫座|3#,1#|付|2", $ListView1)
$arr1[9]=GUICtrlCreateListViewItem("DKD|六角螺栓|M16×300|付|2", $ListView1)
$arr1[10]=GUICtrlCreateListViewItem("DKD|六角螺栓|M16×250|付|2", $ListView1)
$arr1[11]=GUICtrlCreateListViewItem("DKD|断连角铁|∠63×6×504|根|4", $ListView1)
$arr1[12]=GUICtrlCreateListViewItem("DKD|耐张绝缘子串|XP-40C|串|4", $ListView1)
$arr1[13]=GUICtrlCreateListViewItem("DKD|六角螺栓|M16×35|付|8", $ListView1)
$arr1[14]=GUICtrlCreateListViewItem("DKD|垫片|φ17.5|个|28", $ListView1)
For $i=3 To 14
GUICtrlsetState($arr1[$i],$GUI_CHECKED)
Next
$ListView2 = GUICtrlCreateListView("杆型|名称|型号|单位|数量", 479, 8, 313, 145, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_FULLROWSELECT))
$Button1 = GUICtrlCreateButton("添加", 360, 32, 89, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Button1Click()
For $i=0 To 14
If _GUICtrlListView_GetItemChecked($ListView1,$i) Then
GUICtrlCreateListViewItem(GUICtrlRead($arr1[$i]), $ListView2)
endif
Next
EndFunc
Func Form1Close()
Exit
EndFunc ;==>Form1Close