本帖最后由 水木子 于 2010-4-19 12:26 编辑 #include <GUIListBox.au3>
#include <WindowsConstants.au3>
$Path = @ScriptDir & '\Config.ini'
GUICreate("软件安装", 380, 350)
$List1 = GUICtrlCreateList("", 5, 5, 370, 280, $WS_VSCROLL)
$But1 = GUICtrlCreateButton("安装", 80, 300, 80, 30)
$But2 = GUICtrlCreateButton("取消", 220, 300, 80, 30)
GUISetState(@SW_SHOW)
Read()
Func Read()
Local $z = 1
$var = IniReadSection($Path, 'Config')
If Not @error Then
For $i = 1 To $var[0][0]
_GUICtrlListBox_AddString($List1, '[' & $z & '/' & $var[0][0] & ']' & $var[$i][0])
$z += 1
Next
EndIf
EndFunc ;==>Read
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3, $But2
Exit
Case $But1
begin()
EndSwitch
WEnd
Func begin()
Local $z = 1
$Instal = IniReadSection($Path, 'Config')
If Not @error Then
For $i = 1 To $Instal[0][0]
$z += 1
_GUICtrlListBox_ReplaceString($List1, $i - 1, "→ " & "[" & $z & "/" & $Instal[0][0] & "]" & " " & $Instal[$i][0]);取代文字的一个项目
_GUICtrlListBox_SetCurSel($List1, $i - 1)
Sleep(500)
_GUICtrlListBox_ReplaceString($List1, $i - 1, "OK " & "[" & $z & "/" & $Instal[0][0] & "]" & " " & $Instal[$i][0])
_GUICtrlListBox_SetCurSel($List1, $i - 1)
Next
EndIf
EndFunc ;==>begin
|