回复 8# ipmitool
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $iI, $idListview
DIM $ARRAY[11]
$ARRAY[0]="Halt"
$ARRAY[1]="On-going"
$ARRAY[2]="Halt"
$ARRAY[3]="Halt"
$ARRAY[4]="On-going"
$ARRAY[5]="Halt"
$ARRAY[6]="Halt"
$ARRAY[7]="On-going"
$ARRAY[8]="Halt"
$ARRAY[9]="On-going"
$ARRAY[10]="Halt"
GUICreate("ListView Find In Text", 400, 300)
$idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
; Add columns
_GUICtrlListView_InsertColumn($idListview, 0, "Items", 100)
; Add items
_GUICtrlListView_BeginUpdate($idListview)
FOR $i=0 TO 10
_GUICtrlListView_AddItem($idListview,$ARRAY[$i])
Next
_GUICtrlListView_EndUpdate($idListview)
; Search for target item
$a=0
FOR $i=0 TO 10
If $ARRAY[$i]="Halt" THEN $a=$a+1
Next
MsgBox(0,"","Halt 一共 "&$a&" 個")
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
|