本帖最后由 qq342252004 于 2010-11-28 17:25 编辑 #include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $pot = ""
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 369, 70, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 16, 24, 145, 25,BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("确定&(Y)", 184, 24, 75, 25)
$Button2 = GUICtrlCreateButton("退出&(X)", 272, 24, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$var = IniReadSectionNames(@ScriptDir&'\成绩.ini')
If @error Then
Else
For $i = 1 To $var[0]
$pot = $pot & "|" & $var[$i]
Next
GUICtrlSetData($Combo1, StringTrimLeft ($pot, 1), $var[1])
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$var = IniReadSection(@ScriptDir&'\成绩.ini',GUICtrlRead($Combo1))
If @error Then
Else
For $i = 1 To $var[0][0]
MsgBox(0,$var[$i][0],$var[$i][1])
Next
EndIf
Case $Button2
Exit
EndSwitch
WEnd
配置文件:
[张老三]
张老三 = 90分
[李小四]
李小四 = 95分
[王老五]
王老五 = 87分
[任小六]
任小六 = 75分 |