你的意思是同时选三个key?
上面的我给的代码就可以直接读出选定的项目呀
#NoTrayIcon
#include <GuiConstants.au3>
Opt("GUIOnEventMode", 1)
Local $INIFile = @ScriptDir & "\zh-CN.ini"
if not FileExists($INIFile) then
msgbox(16, "Error", "Cannot find INI file",5)
Exit
EndIf
$Form1 = GUICreate("Example", 300, 500)
GUISetOnEvent($GUI_EVENT_CLOSE, "Event")
$TreeView = GUICtrlCreateTreeView(10, 10, 200, 450)
GUICtrlSetOnEvent(-1, "Event")
$SectionName = IniReadSectionNames($INIFile)
If IsArray($SectionName) Then
Local $Item[$SectionName[0] + 1]
For $i = 1 To $SectionName[0]
$Item[$i] = GUICtrlCreateTreeViewItem($SectionName[$i], $TreeView)
GUICtrlSetOnEvent(-1, "Event")
$IniSection = IniReadSection($INIFile, $SectionName[$i])
if not @error Then
For $j = 1 To $IniSection[0][0]
GUICtrlCreateTreeViewItem($IniSection[$j][0], $Item[$i])
GUICtrlSetOnEvent(-1, "Event")
GUICtrlCreateTreeViewItem($IniSection[$j][1], -1)
GUICtrlSetOnEvent(-1, "Event")
Next
EndIf
Next
EndIf
GUISetState()
While True
Sleep(100)
WEnd
Func Event()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case Else
$Val = GUICtrlRead(@GUI_CtrlId,1)
MsgBox(0,0,$Val)
;......
EndSwitch
EndFunc
|