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
  1. Home
  2. General Programming
  3. Visual Basic
  4. custom treeview

custom treeview

Scheduled Pinned Locked Moved Visual Basic
visual-studiohelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SHaroz
    wrote on last edited by
    #1

    I've created a my own node class that inherits from treenode and included some extra properties. When I try and add one to a normal treeview, my custom properties are gone. Here is what I do: Dim temp as new myNode() with temp 'set some properties End with treeview1.nodes.add(temp) 'I'm assuming that here it gets converted to a normal node. To get around this, I tried to make a custom TreeNodeCollection, but the IDE gives me problems with sub new. To see the errors, copy this: Public Class myCol Inherits TreeNodeCollection '... End Class I would greatly appriciate any help. -Steve

    P 1 Reply Last reply
    0
    • S SHaroz

      I've created a my own node class that inherits from treenode and included some extra properties. When I try and add one to a normal treeview, my custom properties are gone. Here is what I do: Dim temp as new myNode() with temp 'set some properties End with treeview1.nodes.add(temp) 'I'm assuming that here it gets converted to a normal node. To get around this, I tried to make a custom TreeNodeCollection, but the IDE gives me problems with sub new. To see the errors, copy this: Public Class myCol Inherits TreeNodeCollection '... End Class I would greatly appriciate any help. -Steve

      P Offline
      P Offline
      Poolbeer
      wrote on last edited by
      #2

      Hi, When your going to retrieve the TreeNode you'll have to cast it to the right object-type like - Custom node-class = TreeNodeEx Private Sub TreeNode1_Click(sender as object, e as TreenodeEventArgs) ... Dim MyTreeNodeEx As TreeNodeEx MyTreeNodeEx = CType(e.Nodes.SelectedNode, TreeNodeX) ... End Sub This is what I'm doing when using the treeview with custom nodes. I hope this answers your question. Greets, Poolbeer Sorry no sigh yet

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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