GuiCtrlCreateListView问题,如何让对话框停住不消失.
本帖最后由 neity 于 2009-5-27 08:57 编辑#include <GuiListView.au3>
Dim $data_array = ["", "192.168.1.6 | HP-968B0D898 | Administrator|16:44:31|24/04/2009", _
"192.168.1.6 | HP-968B0D898 | Administrator|16:45:08|24/04/2009", _
"192.168.1.6 | HP-968B0D898 | Administrator|16:45:14|24/04/2009"]
Dim $data_count = 3
$GUI = GuiCreate("", 600, 300, 300, 300)
GUISetFont(9, 400, 0, "Lucida Console")
$hListView = GuiCtrlCreateListView("", 5, 5, 550, 200)
_GUICtrlListView_AddColumn($hListView, "IP ADDRESS", 120)
_GUICtrlListView_AddColumn($hListView, "COMPUTER TYPE", 120)
_GUICtrlListView_AddColumn($hListView, "USER", 124)
_GUICtrlListView_AddColumn($hListView, "DATE", 90)
_GUICtrlListView_AddColumn($hListView, "TIME", 90)
GUISetState(@SW_SHOW, $GUI)
For $x = 1 to $data_count
$y = StringSplit($data_array[$x], "|")
_GUICtrlListView_AddItem($hListView, $y)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 1)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 2)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 3)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 4)
Next
sleep(5000)
如果不用sleep,怎么让对话框,一直停留,而不自动退出,除非按退出(X). 难题呀,困扰我很久啦,先谢啦,请各位同仁帮个忙啦 晕,这个问题真是....#include <GuiListView.au3>
#include <GUIConstants.au3>
Dim $data_array = ["", "192.168.1.6 | HP-968B0D898 | Administrator|16:44:31|24/04/2009", _
"192.168.1.6 | HP-968B0D898 | Administrator|16:45:08|24/04/2009", _
"192.168.1.6 | HP-968B0D898 | Administrator|16:45:14|24/04/2009"]
Dim $data_count = 3
$GUI = GuiCreate("", 600, 300, 300, 300)
GUISetFont(9, 400, 0, "Lucida Console")
$hListView = GuiCtrlCreateListView("", 5, 5, 550, 200)
_GUICtrlListView_AddColumn($hListView, "IP ADDRESS", 120)
_GUICtrlListView_AddColumn($hListView, "COMPUTER TYPE", 120)
_GUICtrlListView_AddColumn($hListView, "USER", 124)
_GUICtrlListView_AddColumn($hListView, "DATE", 90)
_GUICtrlListView_AddColumn($hListView, "TIME", 90)
GUISetState(@SW_SHOW, $GUI)
For $x = 1 to $data_count
$y = StringSplit($data_array[$x], "|")
_GUICtrlListView_AddItem($hListView, $y)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 1)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 2)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 3)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y, 4)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd代码前加一句:#include <GUIConstants.au3>
末尾加一段while循环来触发gui的事件:例如你想要‘不自动退出,除非按退出(X)’ 好好看看skyfree的教程,里面写得已经够浅显了
如果还看不懂就结合帮助文件的例子来学习
这样会避免很多的所谓‘难题呀,困扰我很久啦’的问题了 谢谢!!!!!!!!!!!!!!!
页:
[1]