Results 1 to 4 of 4

Thread: [RESOLVED] Treeview. Click / Afterselect troubles

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    10

    Resolved [RESOLVED] Treeview. Click / Afterselect troubles

    Hi; I'm having some trouble with coding my treeview in VB.NET

    I have the following subs in place;

    Treeview1_MouseUP(ByVal etc etc etc)
    Treeview1_Afterselect(Byval etc etc etc).

    Now; The problem is, MouseUp should really be executed after selection.
    For example; Situation is:
    ~Parent
    ~~~Child1
    ~~~Child2

    Currently Child1 is selected.
    I RIGHTCLICK child2. I want the 'MouseUp' event to reference to Child2 at that moment in time. But Treeview1.selectednode still refers to child1 .

    How do I get 'Treeview1_MouseUP' to see Child2 as the 'active item' instead of Child1?


    Thanks!
    Last edited by sdm1; Jul 26th, 2006 at 03:14 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Treeview. Click / Afterselect troubles

    TreeView.GetNodeAt(e.X, e.Y)
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    10

    Re: [2005] Treeview. Click / Afterselect troubles

    Works like a charm! Thanks a lot!

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] Treeview. Click / Afterselect troubles

    Just note that you should allow for the situation where the event occurs at a point where there is no node.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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