找回密码
 加入
搜索
查看: 2470|回复: 3

[效率算法] 求帮忙看下 _GUICtrlListView_AddArray 这个函数的代码

[复制链接]
发表于 2015-2-15 11:23:53 | 显示全部楼层 |阅读模式
#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()

这个程序打开个窗口就自动退出,而且,并没有显示出来。      想实现把那个数组填充到列表框里面 ,并且能按三秒一次自动更新,请教大神。
发表于 2015-2-15 12:26:28 | 显示全部楼层
endw好像是wend吧
发表于 2015-2-15 13:24:57 | 显示全部楼层
这是第一个,另外为什么放到while循环里
发表于 2015-2-15 13:25:05 | 显示全部楼层
本帖最后由 半芯竹 于 2015-2-15 13:39 编辑

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
$Debug_LV = False 
        Local $iI, $iTimer, $hListView,$aArray,$HTML,$aItems[1000][1]
        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][0] = $aArray[$iI]
    Next
  _GUICtrlListView_AddArray($hListView, $aItems)
EndFunc   ;==>_Main

你自己测试下吧。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-6 04:27 , Processed in 0.079362 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表