GUIListBox效果(已解决)
本帖最后由 jinhao 于 2010-3-21 11:10 编辑如何用更好的方法实现的功能?#include <array.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
Global $J = 0,$J0 = 0
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 347, 218, -1, -1)
$List1 = GUICtrlCreateList("", 0, 0, 345, 214,$WS_VSCROLL)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$aSectionNames = IniReadSectionNames("e:\List.txt")
For $i = 1 To $aSectionNames
$aKeyWord = IniReadSection("e:\List.txt", $aSectionNames[$i])
For $o = 1 To $aKeyWord
$j0=$j0+1
_GUICtrlListBox_AddString($List1,"["&$j0&"/"&$aKeyWord&"]"&" "&$aKeyWord[$o])
Next
Next
For $i = 1 To $aSectionNames
$aKeyWord = IniReadSection("e:\List.txt", $aSectionNames[$i])
For $o = 1 To $aKeyWord
$J = $J + 1
_GUICtrlListBox_ReplaceString($List1,$o-1,"["&$J&"/"&$aKeyWord&"]"&" "&$aKeyWord[$o])
_GUICtrlListBox_SetCurSel($List1, $o-1)
Sleep(1000)
_GUICtrlListBox_ReplaceString($List1,$o-1,"["&$J&"/"&$aKeyWord&"]"&" "&$aKeyWord[$o])
_GUICtrlListBox_SetCurSel($List1, $o-1)
If $J == $aKeyWord Then
MsgBox(0,'提示','完成')
EndIf
Next
Next
C:\WINDOWS\addins=
C:\WINDOWS\AppPatch=
C:\WINDOWS\assembly=
C:\WINDOWS\Config=
C:\WINDOWS\Cursors=
C:\WINDOWS\Debug=
C:\WINDOWS\Downloaded Installations=
C:\WINDOWS\Driver Cache=
C:\WINDOWS\ime=
C:\WINDOWS\java=
C:\WINDOWS\LastGood=
C:\WINDOWS\LastGood.Tmp=
C:\WINDOWS\Logs= 本帖最后由 水木子 于 2010-3-21 10:50 编辑
这个问题之前我不是已经帮你解决了吗?
本帖最后由 水木子 于 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
_GUICtrlListBox_AddString($List1, '[' & $z & '/' & $var & ']' & $var[$i])
$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
$z += 1
_GUICtrlListBox_ReplaceString($List1, $i - 1, "→ " & "[" & $z & "/" & $Instal & "]" & " " & $Instal[$i]);取代文字的一个项目
_GUICtrlListBox_SetCurSel($List1, $i - 1)
Sleep(500)
_GUICtrlListBox_ReplaceString($List1, $i - 1, "OK " & "[" & $z & "/" & $Instal & "]" & " " & $Instal[$i])
_GUICtrlListBox_SetCurSel($List1, $i - 1)
Next
EndIf
EndFunc ;==>begin 配置文件格式如下,自己任意改吧!
C:\autoit3=
C:\autoit3=
C:\autoit3=
C:\autoit3=
C:\autoit3=
C:\autoit3=
C:\autoit3= 写的非常不错,收藏。。。。。。。。 不错,标记后用。 顶,看看学习一下再说
页:
[1]