none
How to make options page nested 3 levels deep RRS feed

  • Question

  • I need to make an option page that's nested down three levels [product]\[feature]\[options].  This is done all over the place in options, such as Environment\Help\Dynamic Help.  I have no problem nesting 2 levels with a category and page name, but 3 levels seems impossible.  Can anyone tell me how to do this?  Thanks!

    Thursday, October 18, 2007 10:29 PM

Answers

  • It is a matter of creating the registration for it.  It does seem that the provide attribute (ProvideOptionPageAttribute) does not support it.  However, you can simply create registry entries under your existing entries, and you will get the proper hierachy of pages.  Look under

     

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ToolsOptionsPages\Environment\Help

     

    to see an example.

     

     

    Wednesday, December 5, 2007 10:13 PM
    Moderator

All replies

  • It is a matter of creating the registration for it.  It does seem that the provide attribute (ProvideOptionPageAttribute) does not support it.  However, you can simply create registry entries under your existing entries, and you will get the proper hierachy of pages.  Look under

     

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ToolsOptionsPages\Environment\Help

     

    to see an example.

     

     

    Wednesday, December 5, 2007 10:13 PM
    Moderator
  • In case anyone is looking for this information for use with VS 2010/2012 (as I was), I just wanted to save them the trouble of searching further than here.

    In the VSPackage class, when you add the ProvideOptionPage attribute, use a backslash between the desired nested levels.

    So like this:

    [ProvideOptionPage(typeof(GeneralOptionsPage), "Category Name", @"Sub Category Name\General", 0, 0, true)]
    
    [ProvideOptionPage(typeof(AdvancedOptionsPage), "Category Name", @"Sub Category Name\Advanced", 0, 0, true)]
    
    
    This will result in nested settings pages, like this:

    Category Name
        > Sub Category Name
            > General
            > Advanced

    I hope this helps someone, as it doesn't actually seem to be documented anywhere. I just tried it, based on the information that Carl said was put into the registry.

    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Saturday, January 5, 2013 4:35 PM