Results 1 to 3 of 3

Thread: Preventing a User from selecting a TreeView Node

  1. #1

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Preventing a User from selecting a TreeView Node

    I have a TreeView that I am using for display purposes only. I don't want the user to be able to select any of the nodes. Setting the enabled property of the form to False doesn't suffice since it changes the entire look of the nodes.

    I tried canceling the select action in the BeforeExpand event. It kind of works. It selects, then de-selects the item. I'm going to play around with other events to see what I can come up with, but would appreciate any information.

    Thanks
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

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

    Re: Preventing a User from selecting a TreeView Node

    Presumably the BeforeSelect event would be the way to go rather than BeforeExpand.
    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
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Preventing a User from selecting a TreeView Node

    Quote Originally Posted by jmcilhinney View Post
    Presumably the BeforeSelect event would be the way to go rather than BeforeExpand.
    BeforeSelect is the event I'm using. I'm not sure why I typed BeforeExpand :P
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

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