Results 1 to 8 of 8

Thread: How do i create an instance of a TreeNodeCollection?

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    How do i create an instance of a TreeNodeCollection?

    i tried:
    Dim Tree as new TreeNodeCollection() but it seems not to want to work..any ideias of what i am doing wrong?

    edit: it seems it needs a TreeNode as constructor but still it is said to be as private...any ways around of doing this?
    Last edited by PT Exorcist; Apr 21st, 2003 at 02:42 PM.
    \m/\m/

  2. #2

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    damn just found out it is internal..i'll try to recreate it though
    \m/\m/

  3. #3
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Don't use New and it seems to work. Not sure if this answers your question though...

  4. #4

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    whats the use if i dont use New? if i dont use New then i am not creating an instance and that way i can do $null with it
    \m/\m/

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can use an array of nodes or a collection. You can also build on to one node and then transfer all of its children nodes to an existing TreeNodecollection. What is it you are trying to do with the TreeNodeCollection?

  6. #6

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i would like to have a treeview with some new functionality...that way i wanted to have a a treenode that when the user made the Nodes.Add() it'd throw an event
    \m/\m/

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Are you inheriting the normal treeview? Wouldn't that give you access to the TreeNodeCollection from the base object?

    You can't override the Nodes property but you can shadow it and check for a change in the count or something of that nature.

    They do make it a bit difficult to work with the TreeNodeCollection in any non-default manner don't they.
    Last edited by Edneeis; Apr 21st, 2003 at 05:43 PM.

  8. #8

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    yes i am inheriting the treeview..but to make the change ill have to create another class that inherits from the TreeNodeCollection so i can make the changes and make the treeview 'Nodes' object point to my "extended" TreeNodeCollection, i can't use a normal array as it wouldn't create the correct items in the treeview i think..
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width