Results 1 to 8 of 8

Thread: [RESOLVED] Treeview: Disable a node from being able to be selected

  1. #1

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Resolved [RESOLVED] Treeview: Disable a node from being able to be selected

    I know treeview has issues with checkboxes, so I need to know if there is a way to disable a node and a node item from being able to be selected at all (but stay visible). There is no enable/disable property so how can one achieve this?

  2. #2
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Treeview: Disable a node from being able to be selected

    This is really a shot in the dark, but have you looked at the vbAccelerator TreeView? I havn't actually used it myself, but there is a good chance it has an enable/disable property.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  3. #3
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Re: Treeview: Disable a node from being able to be selected

    I would do it by setting the SelectedItem property to Nothing when the "disabled" node is clicked.

    If you are using icons on your nodes, you could also visually indicate that a node is "disabled" by using a different icon for that node (i.e., a gray-scale version of the normal icon you would use for an "enabled" node).
    "It's cold gin time again ..."

    Check out my website here.

  4. #4

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Treeview: Disable a node from being able to be selected

    Well, what I am attempting to do is to avoid the checkbox being checked at all. If you can click on the node it will toggle the checkbox regardless. I want to avoid the checkbox being checked at all.

  5. #5

  6. #6

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Treeview: Disable a node from being able to be selected

    MartinLiss,

    Yes, that did the trick soon as I figured out how and why it worked. Exactly what I needed to accomplish. Thanks.

  7. #7
    New Member
    Join Date
    Sep 2016
    Posts
    12

    Re: Treeview: Disable a node from being able to be selected

    Quote Originally Posted by randem View Post
    MartinLiss,

    Yes, that did the trick soon as I figured out how and why it worked. Exactly what I needed to accomplish. Thanks.
    I a, trying to do the same thing but the link he posted above does not work. I am looking to do this exact same thing. Any help would be appreciated.

  8. #8
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Treeview: Disable a node from being able to be selected

    After 11 years I'm not surprised. I don't remember what I was pointing to but this https://matteo72.wordpress.com/2013/...oxes-in-nodes/ gives a solution. The If Node.Tag = "DISABLED" Then line could be changed to If Node.Text = "blah" Then, etc.

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