Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Command1_Click()
Const ControlDoesntHaveIndexProperty% = 343
Dim objCurrentNode As Node
Dim objNode As Node
Dim objControl As Control
Dim sName As String
On Error GoTo Hell
With TreeView1
.Style = tvwTreelinesPlusMinusPictureText
.BorderStyle = vbFixedSingle
.LineStyle = tvwRootLines
End With
Set objCurrentNode = TreeView1.Nodes.Add( _
, , Me.Name, Me.Name)
For Each objControl In Me.Controls
sName = objControl.Name
sName = sName & "(" & objControl.Index & ")"
For Each objNode In TreeView1.Nodes
If objControl.Container.Name = objNode.Key Then
Set objCurrentNode = TreeView1.Nodes.Add( _
objNode.Key, tvwChild, sName, sName)
Exit For
End If
Next
Next
Exit Sub
Hell:
If Err.Number = ControlDoesntHaveIndexProperty Then
Resume Next
Else
MsgBox Err.Description, , Err.Number
End If
End Sub