CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Beaverton, OR
    Posts
    241

    TreeView question

    I'm stuck using VB at work, and I'm hoping that I can get some help on something here. I'm using the TreeView controls HitTest method. According to MSDN, this will return 'Nothing' if the XY coordinates do not match up to a tree item. Yet, I can't find a way to compare my node object to 'Nothing'. I always get run time errors. Any body know enough about the Tree Control in VB to help?


  2. #2

    Re: TreeView question

    To compare any object variable to nothing you use the following:

    if obj is nothing then ..

    So the correct syntax using the HitTest method should be:

    if TreeView1.HitTest(x,y) is Nothing Then
    'DO whatever
    end if

    Charlie Zimmerman
    http://www.freevbcode.com


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

Featured