Results 1 to 9 of 9

Thread: Ref. to treeview control

  1. #1

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    I think TreeView canbe found under System.Windows.Forms.Treeview

    Try something like this...

    Imports System.Windows.Forms
    Public Function MyTreeFunction(ByVal tree As TreeView)

    Or you can fully qualify it.
    Public Function MyTreeFunction(ByVal tree As System.Windows.Forms.TreeView)

    Hope this helps.

    That which does not kill us, only makes us stronger.

  2. #2
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251
    Unfortunately this does not work in a module as you can't reference System.Windows.forms in a module.

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    change the to ByRef tree As System.Windows.Forms.Treeview

    .net upgrade wizard sux!!
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251
    Unfortunately I can't get a reference to the Windows.Forms namespace in a module.

    So you cannot use...

    Public Function MyFunction( byref tree as Window.Forms.Form.Treeview)


    I would preferred to use a class but I seem to have the same problem. The class would povide high level functions to add nodes to trees and various other useful functions relating to treeviews.

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    i said
    System.Windows.Forms.Treeview


    Windows.forms.Form.Treeview is incorrect.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251
    Sorry, Sorry , Sorry!!! but thanks.

    The problem was that I am using a class library project and it does not automatically add the ref: Window.Forms.Form. After I added the reference manually it was possible to declare the function.

    Thanks for your help, I really appreciate it.

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    oh I see..ok cool..
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  8. #8

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Unfortunately this does not work in a module as you can't reference System.Windows.forms in a module.
    I didn't have a problem getting to that namspace in a module. If you still can't get to it, maybe you don't have a reference you need. Although, I think it would be a sad day when the System namespace is unavailable.
    That which does not kill us, only makes us stronger.

  9. #9

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Oops. I see you have already resolved the problem. Disregard last transmittion.
    That which does not kill us, only makes us stronger.

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