Set tvwMain = Controls.Add("MSComctlLib.TreeCtrl.2", "tvwMain")
With tvwMain
.Visible = True
.Top = 0
.Left = 0
.Height = 5000
End With
Debug.Print Me.Controls.Count
Debug.Print Me.Controls(0).Name
Debug.Print Me.Controls(1).Name
End Sub
When the first debug statement executes, it prints 2. The second two show the names "Treeview1" and "tvwMain" respectively. Why is the code adding two controls? The attached screen shot is the resulting form (?????)
Last edited by ahara; May 10th, 2004 at 09:07 AM.
"Knowledge is gained when different people look at the same information in different ways"
well....I copied the code into another project and it adds only one control. Upon further investigation, I had an option checked off that I should not have. Problem resolved.
"Knowledge is gained when different people look at the same information in different ways"
"Remove information about unused Active X components" was unchecked....seems like the control was initially added, and then it somehow persisted.....when I reopened the original project, I could see it on the form at design time. I deleted it, unchecked the option (as error msg instructed to do so) and then it worked. (???)
But it works now, so I'm
"Knowledge is gained when different people look at the same information in different ways"