回复 16# blue_dvd
或者 你不要用 _GUICtrlListView_AddArray
用原本的方法 可以解決 閃 的問題....
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <ColorConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 591, 349, 192, 114)
$ListView1 = GUICtrlCreateListView("", 24, 24, 546, 302)
GUICtrlSendMsg($ListView1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
_GUICtrlListView_AddColumn($ListView1, "Item1",100)
_GUICtrlListView_AddColumn($ListView1, "nSubItem1", 100)
_GUICtrlListView_AddColumn($ListView1, "nSubItem2", 100)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Local $GUI, $hImage, $iITEM_COUNT =1000
Local $sSomeString = ""
Local $aBoy[$iITEM_COUNT][3]
For $i = 0 To $iITEM_COUNT - 1;初始化??
$aBoy[$i][0] = "??" & $i
$aBoy[$i][1] = "爸爸" & $i
$aBoy[$i][2] = "儿子" & $i
Next
Local $aShowdata = $aBoy
_GUICtrlListView_BeginUpdate($ListView1)
for $i=0 to UBound($aShowdata ,1)-1
$t_a=$aShowdata[$i][0]
For $j=1 To UBound($aShowdata,2) - 1
$t_a=$t_a&"|"&$aShowdata[$i][$j]
Next
;MsgBox(0,"提醒", $t_a)
GUICtrlCreateListViewItem($t_a,$ListView1)
Next
;?置列?
For $i = 0 To UBound($aShowdata ,2) - 1
_GUICtrlListView_SetColumnWidth($ListView1, $i, $LVSCW_AUTOSIZE) ;?置列??不懂
Next
local $ii=0
;?置行?隔?色
For $i = 0 To UBound($aShowdata,1) - 1
if mod($i,2)=0 Then
; $ii= _GUICtrlListView_SetItemSelected($ListView1, $i)
; $a = ControlListView($form1, "", $ListView1, "GetSelected", $ii)
; ConsoleWrite($a&@CRLF)
GUICtrlSetBkColor(_GUICtrlListView_GetItemParam($ListView1, $i), $COLOR_BLUE) ;?色
ConsoleWrite(_GUICtrlListView_GetItemParam($ListView1, $i)&@CRLF)
EndIf
Next
_GUICtrlListView_EndUpdate($ListView1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|