Cimplicity Basic Tree View

I am making a Screen in Cimplicity 2022 and I'm trying to make a tree view using a .NET Object "System.Windows.Forms.TreeView" but when I attempt to create the tree with subsequent nodes in my basic script(which I'll paste below), nothing populates the form when I test the screen and I get an error in the script "Runtime error 423: Property or method not found. It appears that Cimplicity isn't recognizing the tree object and the Nodes method, but I am not sure how to fix that.

Code:
Sub InitializeTreeView()

    Dim oCimScr As GefScreen
    Dim oCimScrObj As GefObject
    Dim treeView1 As Object   
   
    Set oCimScr = CimGetScreen
    Set oCimScrObj = oCimScr.Object
    Set treeView1 = cimgetscreen.Object.objects.item("treeView1").oleobject

    'treeView1.BeginUpdate()
    msgbox treeView1.nodes.count
'    d = treeView1.Nodes.Add("Parent")
'    d = treeView1.Nodes(0).Nodes.Add("Child 1")
'    d = treeView1.Nodes(0).Nodes.Add("Child 2")
'    d = treeView1.Nodes(0).Nodes(1).Nodes.Add("Grandchild")
'    d = treeView1.Nodes(0).Nodes(1).Nodes(0).Nodes.Add("Great Grandchild")
    'treeView1.EndUpdate()
End Sub
Any help would be appreciated or a redirect to better resources.
 
Top