参考:
Dim trv As WinForm.TreeView = Forms("窗口1").controls("TreeView1")
Dim dr As DataRow
Dim str() As String = {"根目录","子目录","窗口名","按钮名称","按钮标题"}
For Each n As WinForm.TreeNode In trv.AllNodes
If n.Nodes.Count = 0 Then
Dim arr() As String = n.FullPath.Split("\")
dr = DataTables("窗口控件管理表").AddNew
For i As Integer = 0 To arr.Length - 1
dr(str(i)) = arr(i)
Next
End If
Next