Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 9285131

@User 9285131
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Treeview iteration
    U User 9285131

    Hi thx Richard for that info Not familiar with recursion, but now you've helped me improve my understanding of treeviews. I did circumvent the problem by updating node properties as they are created. I can post that code if it might help others. demac ;)

    Windows Forms design data-structures help announcement

  • Treeview iteration
    U User 9285131

    I have a tree created at design time with 3 root nodes and 3 levels 3x3x3 =39 nodes as the default.

    The nodes can be dynamically recreated.

    When I cleared the nodes then recreated them, I tried looping through to add properties to the nodes of each level including their relevant context menu name.

    Private Sub RedoTree\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RedoTree.Click
    
    	treeLoad()
    	treeExecutive.ExpandAll()
    	restoreTP()
    	treeExecutive.Nodes(0).EnsureVisible()
    
    End Sub
    
    Sub restoreTP() '				renew treenode properties
    
    	Dim s As String, l As Short
    
    	treeExecutive.Update()
    
    	For Each treenode In treeExecutive.Nodes
    		s = treenode.Name
    		l = Len(s)
    		treenode.ForeColor = Color.GhostWhite
    
    		If treenode.Text <> s Then treenode.ForeColor = Color.Black
    
    		Select Case l
    			Case 1
    				treenode.NodeFont = New Font("Arial Rounded MT Bold", 10.8)
    				treenode.ContextMenuStrip = CMSRoot
    			Case 2
    				treenode.NodeFont = New Font("Arial", 10.2)
    				treenode.ContextMenuStrip = CMSTree
    			Case Else
    				treenode.NodeFont = New Font("Arial Narrow", 9)
    				treenode.ContextMenuStrip = CMSTree
    		End Select
    
    	Next
    
    End Sub
    

    The root nodes are number 1-3, then 11,12,13 .... 111,112,113 Total is 39 nodes

    ONLY THE ROOT NODES ARE RECOGNISED AND DEALT WITH.

    All the child nodes are ignored as if they don't exist

    Am bogged down on this and would appreciate any help :confused:

    Demac

    Windows Forms design data-structures help announcement

  • Treeview iteration
    U User 9285131

    I have a tree created at design time with 3 root nodes and 3 levels 3x3x3 =39 nodes as the default. The nodes can be dynamically recreated. When I cleared the nodes then recreated them, I tried looping through to add properties to the nodes of each level including their relevant context menu name.

    Private Sub RedoTree\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RedoTree.Click
    
    	treeLoad()
    	treeExecutive.ExpandAll()
    	restoreTP()
    	treeExecutive.Nodes(0).EnsureVisible()
    
    End Sub
    
    Sub restoreTP() '				renew treenode properties
    
    	Dim s As String, l As Short
    
    	treeExecutive.Update()
    
    	For Each treenode In treeExecutive.Nodes
    		s = treenode.Name
    		l = Len(s)
    		treenode.ForeColor = Color.GhostWhite
    
    		If treenode.Text <> s Then treenode.ForeColor = Color.Black
    
    		Select Case l
    			Case 1
    				treenode.NodeFont = New Font("Arial Rounded MT Bold", 10.8)
    				treenode.ContextMenuStrip = CMSRoot
    			Case 2
    				treenode.NodeFont = New Font("Arial", 10.2)
    				treenode.ContextMenuStrip = CMSTree
    			Case Else
    				treenode.NodeFont = New Font("Arial Narrow", 9)
    				treenode.ContextMenuStrip = CMSTree
    		End Select
    
    	Next
    
    End Sub
    

    The root nodes are number 1-3, then 11,12,13 .... 111,112,113 Total is 39 nodes

    ONLY THE ROOT NODES ARE RECOGNISED AND DEALT WITH.

    All the child nodes are ignored as if they don't exist

    Am bogged down on this and would appreciate any help :confused:

    demac

    .NET (Core and Framework) design data-structures help announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups