locked
How to make a File/Folder node in Solution Explorer disabled? RRS feed

  • Question

  • I would like to know how to disable the file/folder node in the solution explorer.

    Say if the file is removed from the physical location/hard drive, that particular item can be show as disabled one...

    Thursday, April 10, 2014 10:47 AM

Answers

  • The solution explorer doesn't have a notion of enabled or disabled.

    However, I suspect you may be thinking of the "look" of folders and files that are not included in the project, yet are still displayed due to support for "Show All Files".

    The project type is responsible for this "look", and it's implemented by supporting the VSHPROPID_IsNonMemberItem property in the project hierarchy. When this is set, your hierarchy implementation should provide a different set of icons to represent the file or folder node, by changing what's returned when GetProperty is invoked for VSHPROPID_IconHandle or similar.

    Sincerely,


    Ed Dore

    Thursday, April 10, 2014 5:47 PM