DIAdem-Hilfe

Method: RunInitialize for Tree

  • Aktualisiert2024-09-12
  • 2 Minute(n) Lesezeit

Method: RunInitialize for Tree

Triggers the EventInitialize event for a control in user dialog boxes.

Object.RunInitialize
ObjectTree
Object with this method

After a click on the Button1 button, the following example triggers the EventInitialize event for the Tree1 tree. The EventInitialize fills the tree with content.

Sub Button1_EventClick(ByRef This)
  Call Tree1.RunInitialize
  Call Tree1.Refresh
End Sub

Sub Tree1_EventInitialize(ByRef This)
  Call CreateDefaultTree(This)
End Sub

Sub CreateDefaultTree(ByRef This)
  Dim oFindRoot, oRoot, oMainNode
  This.Nodes.RemoveAll
  Set oRoot = This.Nodes.Add("Tools")
  oRoot.Key = "tools"
  oRoot.Expanded = true
  Set oMainNode = oRoot.Nodes.Add("Electric Tools")
  oMainNode.Key = "electric"
  oMainNode.Nodes.Add("Drill").Key = "drill"
  oMainNode.Nodes.Add("Saw").Key = "saw"
  Set oMainNode = oRoot.Nodes.Add("Hand Tools")
  oMainNode.Key = "handtool"
  oMainNode.Nodes.Add("Hammer").Key = "hammer"
  oMainNode.Nodes.Add("Screwdriver").Key = "screwdriver"
End Sub