回复 7# jianganew
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
$Debug_LV = False
_Main()
Func _Main()
Local $aItem, $sText, $hListView
GUICreate("列計算", 400, 300)
$hListView = GUICtrlCreateListView("col1|col2|col3|col4|col5", 2, 2, 394, 268)
GUICtrlCreateListViewItem("line1|1|2|3|4", $hListView)
GUICtrlCreateListViewItem("line2|2|3|4|5", $hListView)
GUICtrlCreateListViewItem("line3|3|4|5|6", $hListView)
GUICtrlCreateListViewItem("line4|4|5|6|7", $hListView)
GUICtrlCreateListViewItem("line5|5|6|7|8", $hListView)
GUICtrlCreateListViewItem("line6|6|7|8|9", $hListView)
GUICtrlCreateListViewItem("line7|7|8|9|10", $hListView)
GUICtrlCreateListViewItem("line8|8|9|10|11", $hListView)
GUISetState()
$hang=_GUICtrlListView_GetItemCount($hListview)
$lie=_GUICtrlListView_GetColumnCount($hListview)
Local $aArray
FOR $j=1 TO 3
$TOTAL=0
For $i=0 to $hang-1 Step 1
$aArray=_GUICtrlListView_GetItemText($hListview,$i,$j)
$TOTAL=$TOTAL+$aArray
Next
MsgBox(4096,"測試","第 "&$j&" 欄的總合為: " &$TOTAL)
Next
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
|