#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <File.au3>
Example()
Func Example()
Local $idListview
GUICreate("ListView Set Item Count", 400, 300)
$idListview = GUICtrlCreateListView("Line", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
Local $sFile = @ScriptDir & '\active.txt'
Local $hFile = FileOpen($sFile, FileGetEncoding($sFile))
Local $sReadFile = FileRead($hFile)
FileClose($hFile)
Local $aLines = StringRegExp($sReadFile, '\V+', 3)
If Not @error Then
; Add columns
For $x = 0 To UBound($aLines) - 1
_GUICtrlListView_AddItem($idListview, $aLines[$x])
Next
EndIf
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
|