order := {("键盘命令"):{("1-1"):("黑"), ("1-2"):("白")} , ("鼠标命令"):{("2-1"):("红"), ("2-2"):("蓝")} } Gui, Add, TreeView, gMyTreeView H200 biuldTV(order) Gui Show return MyTreeView: TV_GetText(OutputVar, TV_GetSelection()) MsgBox % "Enter was pressed. The selected item ID is " . OutputVar return biuldTV(order:="空", parent:=0) { if IsObject(order) { for k, v in order { ;~ parent := TV_Add(k) biuldTV(v, TV_Add(k, parent)) } } }