<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Treeview plus / minus boxes in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/treeview-plus-minus-boxes/m-p/1307576#M44167</link>
    <description>Can anyone explain why the first example gives me the plus / minus boxes, but the second example after it does not?&lt;BR /&gt;
&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; First example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
Set nod1 = tvwFiles.Nodes.Add(, , "root", arrFilenames(0), "FolderClosed")&lt;BR /&gt;
nod1.Expanded = True&lt;BR /&gt;
nod1.ExpandedImage = "FolderOpen"&lt;BR /&gt;
            &lt;BR /&gt;
For intI = 1 To UBound(arrFilenames)&lt;BR /&gt;
                Err.Clear&lt;BR /&gt;
                Set nod2 = tvwFiles.Nodes.Add("root", tvwChild, , arrFilenames(intI), "Autocad")&lt;BR /&gt;
                If Err = 0 Then AddDummyChild nod2&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
Sub AddDummyChild(nod1 As Node)&lt;BR /&gt;
    'Add a dummy child node, if necessary&lt;BR /&gt;
    If nod1.Children = 0 Then&lt;BR /&gt;
        'Dummy nodes' Text property is "***"&lt;BR /&gt;
        tvwFiles.Nodes.Add nod1.Index, tvwChild, , "***", "State"&lt;BR /&gt;
    End If&lt;BR /&gt;
End Sub&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; First example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
But this example does not show the plus / minus boxes?  Basically, it's the same code except the first 5 lines are removed (and the .add method parameters changed accordingly):&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; Second example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
For intI = 1 To UBound(arrFilenames)&lt;BR /&gt;
                Err.Clear&lt;BR /&gt;
                Set nod2 = tvwFiles.Nodes.Add(, , , arrFilenames(intI), "Autocad")&lt;BR /&gt;
                If Err = 0 Then AddDummyChild nod2&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
Sub AddDummyChild(nod1 As Node)&lt;BR /&gt;
    'Add a dummy child node, if necessary&lt;BR /&gt;
    If nod1.Children = 0 Then&lt;BR /&gt;
        'Dummy nodes' Text property is "***"&lt;BR /&gt;
        tvwFiles.Nodes.Add nod1.Index, tvwChild, , "***", "State"&lt;BR /&gt;
    End If&lt;BR /&gt;
End Sub&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; Second example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
The only difference is I have one more parent node (the folder of the files) on the first example.  I'm still adding the dummy child nodes on the second example, so why don't I get the plus / minus boxes?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Tom</description>
    <pubDate>Tue, 26 Apr 2005 20:03:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-04-26T20:03:01Z</dc:date>
    <item>
      <title>Treeview plus / minus boxes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/treeview-plus-minus-boxes/m-p/1307576#M44167</link>
      <description>Can anyone explain why the first example gives me the plus / minus boxes, but the second example after it does not?&lt;BR /&gt;
&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; First example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
Set nod1 = tvwFiles.Nodes.Add(, , "root", arrFilenames(0), "FolderClosed")&lt;BR /&gt;
nod1.Expanded = True&lt;BR /&gt;
nod1.ExpandedImage = "FolderOpen"&lt;BR /&gt;
            &lt;BR /&gt;
For intI = 1 To UBound(arrFilenames)&lt;BR /&gt;
                Err.Clear&lt;BR /&gt;
                Set nod2 = tvwFiles.Nodes.Add("root", tvwChild, , arrFilenames(intI), "Autocad")&lt;BR /&gt;
                If Err = 0 Then AddDummyChild nod2&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
Sub AddDummyChild(nod1 As Node)&lt;BR /&gt;
    'Add a dummy child node, if necessary&lt;BR /&gt;
    If nod1.Children = 0 Then&lt;BR /&gt;
        'Dummy nodes' Text property is "***"&lt;BR /&gt;
        tvwFiles.Nodes.Add nod1.Index, tvwChild, , "***", "State"&lt;BR /&gt;
    End If&lt;BR /&gt;
End Sub&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; First example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
But this example does not show the plus / minus boxes?  Basically, it's the same code except the first 5 lines are removed (and the .add method parameters changed accordingly):&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; Second example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
For intI = 1 To UBound(arrFilenames)&lt;BR /&gt;
                Err.Clear&lt;BR /&gt;
                Set nod2 = tvwFiles.Nodes.Add(, , , arrFilenames(intI), "Autocad")&lt;BR /&gt;
                If Err = 0 Then AddDummyChild nod2&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
Sub AddDummyChild(nod1 As Node)&lt;BR /&gt;
    'Add a dummy child node, if necessary&lt;BR /&gt;
    If nod1.Children = 0 Then&lt;BR /&gt;
        'Dummy nodes' Text property is "***"&lt;BR /&gt;
        tvwFiles.Nodes.Add nod1.Index, tvwChild, , "***", "State"&lt;BR /&gt;
    End If&lt;BR /&gt;
End Sub&lt;BR /&gt;
&amp;lt;&amp;lt;&amp;lt; Second example &amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
The only difference is I have one more parent node (the folder of the files) on the first example.  I'm still adding the dummy child nodes on the second example, so why don't I get the plus / minus boxes?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Tom</description>
      <pubDate>Tue, 26 Apr 2005 20:03:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/treeview-plus-minus-boxes/m-p/1307576#M44167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-04-26T20:03:01Z</dc:date>
    </item>
  </channel>
</rss>

