#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
Global $hListView
_Main()
Func _Main()
$Form1 = GUICreate("Form1", 740, 610)
$hListView = GUICtrlCreateListView("", 8, 8, 722, 28);cos_text1|cos_text2|cos_text3|cos_text4|cos_text5|cos_text6|cos_text7|cos_text8|cos_text9|
_GUICtrlListView_AddColumn($hListView, "cos_text1", 0, 2);设置列属性
_GUICtrlListView_AddColumn($hListView, "cos_text2", 80, 2)
_GUICtrlListView_AddColumn($hListView, "cos_text3", 80, 2)
_GUICtrlListView_AddColumn($hListView, "cos_text4", 80, 2)
_GUICtrlListView_AddColumn($hListView, "cos_text5", 80, 2)
_GUICtrlListView_AddColumn($hListView, "cos_text6", 80, 2)
_GUICtrlListView_AddColumn($hListView, "cos_text7", 80, 2)
_GUICtrlListView_AddColumn($hListView, "cos_text8", 80, 2)
_GUICtrlListView_AddColumn($hListView, "cos_text9", 80, 2)
GUISetState()
; 循环直到用户退出
tianjia()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
Func tianjia()
Local $iI = 0
For $x = 0 To 26
Local $aItems[1][9]
For $iI = 0 To 0
$aItems[$iI][0] = 'text' & $x
$aItems[$iI][1] = 'text' & $x
$aItems[$iI][2] = 'text' & $x
$aItems[$iI][3] = 'text' & $x
$aItems[$iI][4] = 'text' & $x
$aItems[$iI][5] = 'text' & $x
$aItems[$iI][6] = 'text' & $x
$aItems[$iI][7] = 'text' & $x
$aItems[$iI][8] = 'text' & $x
$iI += 1
Next
_GUICtrlListView_AddArray($hListView, $aItems)
;Sleep(500)
Next
$iY = _GUICtrlListView_ApproximateViewHeight($hListView)
_WinAPI_SetWindowPos(GUICtrlGetHandle($hListView), 0, 8, 8, 722, $iY - 17, $SWP_NOZORDER)
EndFunc ;==>tianjia
|