#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
Local $I, $J, $_Tree_Item[11][11], $_INI_File = @ScriptDir & "\1.ini"
$Form1 = GUICreate("Form1", 196, 400, 192, 124)
$TreeView = GUICtrlCreateTreeView(16, 16, 137, 361)
For $I = 1 To 9
$IniSection = IniRead($_INI_File, "Main", $I, "None")
If $IniSection = "None" Then ExitLoop
$_Tree_Item[$I][0] = GUICtrlCreateTreeViewItem($IniSection, $TreeView)
$IniKey = IniReadSection($_INI_File, $I)
If @error Then ExitLoop
For $J = 1 To $IniKey[0][0]
GUICtrlCreateTreeViewItem($IniKey[$J][1], $_Tree_Item[$I][0])
Next
GUICtrlSetState($_Tree_Item[$I][0], BitOR($GUI_EXPAND, $GUI_DEFBUTTON))
Next
GUISetState(@SW_SHOW)
While 1
If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd
INI文件名:1.ini, 内容:
[Main]
1=股票经济
2=聊天通讯
[1]
1=大智慧
2=民生证券
[2]
1=飞信2008
[ 本帖最后由 漠北雪~狼 于 2009-3-10 18:48 编辑 ] |