#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <GuiListview.au3>
#Region ### START Koda GUI section ### Form=
Local $iExListviewStyle = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES, $LVS_EX_DOUBLEBUFFER)
$Form1 = GUICreate("Form1", 634, 454, 192, 114)
$List1 = GuiCtrlCreateListview("数值1|数值2|数值3", 0, 0, 300, 331)
$List2 = GuiCtrlCreateListview("数值1|数值2|数值3",310,0, 300, 331)
_GuiCtrlListview_SetColumnWidth($List1, 0,450)
GUICtrlSendMsg($List1, $LVM_SETEXTENDEDListviewSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
$item1 = GUICtrlCreateListviewItem("数据内容1|100|1", $List1)
$item2 = GUICtrlCreateListviewItem("数据内容2|100|2", $List1)
$item3 = GUICtrlCreateListviewItem("数据内容2|100|3", $List1)
$item4 = GUICtrlCreateListviewItem("数据内容2|100|4", $List1)
$item5 = GUICtrlCreateListviewItem("数据内容2|100|5", $List1)
$item6 = GUICtrlCreateListviewItem("数据内容2|100|6", $List1)
$hj1=GUICtrlCreateInput("",400,350,100,20)
$hj2=GUICtrlCreateInput("",520,350,100,20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$cont=_GUICtrlListView_GetItemCount ($List1)
$h1=0
$h2=0
for $i=0 to $cont-1
$S=_GUICtrlListView_GetItemTextArray($List1, $i)
$h1=$h1+$S[2]
$h2=$h2+$S[3]
Next
GUICtrlSetData($hj1,$H1)
GUICtrlSetData($hj2,$H2)
_MoreCopyRight()
Func _MoreCopyRight()
$n = InputBox ( "", "请输入数量" , "")
$m=$n
If $n <> "" Then
Do
_GUICtrlListView_ClickItem ($List1,$m-$n)
_GUICtrlListview_CopyItems($List1, $List2)
MsgBox(0,"",$n)
$n -= 1
Until $n = 0
EndIf
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Form1
Case $List1
EndSwitch
WEnd
|