求帮忙看下 _GUICtrlListView_AddArray 这个函数的代码
#include <Array.au3>#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
Local $iI, $iTimer, $idListview,$aItems
; Create GUI
GUICreate("ListView Add Array", 400, 300)
$idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
; Add columns
_GUICtrlListView_AddColumn($idListview, "Items", 100)
_GUICtrlListView_AddColumn($idListview, "SubItems 1", 100)
_GUICtrlListView_SetItemCount($idListview,800)
Local $HTML = BinaryToString(InetRead('http://hq.sinajs.cn/list=AU1506'))
$aArray = StringSplit($HTML, ',')
while 1
_GUICtrlListView_BeginUpdate($idListview)
_GUICtrlListView_AddArray($idListview, $aArray)
_GUICtrlListView_EndUpdate($idListview)
endw
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
这个程序打开个窗口就自动退出,而且,并没有显示出来。 想实现把那个数组填充到列表框里面 ,并且能按三秒一次自动更新,请教大神。 endw好像是wend吧 这是第一个,另外为什么放到while循环里 本帖最后由 半芯竹 于 2015-2-15 13:39 编辑
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
$Debug_LV = False
Local $iI, $iTimer, $hListView,$aArray,$HTML,$aItems
GUICreate("ListView Add Array", 400, 400)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 394)
GUISetState()
_GUICtrlListView_AddColumn($hListView, "Items", 300)
_GUICtrlListView_SetItemCount($hListView, 1000)
AdlibRegister("_main",3000)
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Func _Main()
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($hListView))
$HTML = BinaryToString(InetRead('http://hq.sinajs.cn/list=AU1506'))
$aArray = StringSplit($HTML, ',')
For $iI = 0 To UBound($aArray) - 1
$aItems[$iI] = $aArray[$iI]
Next
_GUICtrlListView_AddArray($hListView, $aItems)
EndFunc ;==>_Main
你自己测试下吧。。
页:
[1]