Add custom pages to the Visual Studio Options dialog.
- Technologies: Visual Studio 2015 SDK
- Topics: Visual Studio Shell, VSX
Description
This sample adds two custom options pages into the standard Visual Studio Options dialog. The sample demonstrates how to customize the presentation and properties' persistence.
Requirements
Goals
- Integrate custom options pages into the Visual Studios Options dialog window
- Properties persistence
- Custom user control as a UI for the property page
The OptionsPage sample contains classes that provide a Visual Studio Package and custom Options Pages integrated into the Visual Studio IDE. The OptionsPagePackage class provides custom options pages via the ProvideOptionsPages attribute.
Use the Microsoft.VisualStudio.Shell.DialogPage class to implement an options page. The sample implements two pages, both of which allow the user to provide custom properties. OptionsPageGeneral uses a standard Property editor control for presentation. OptionsPageCustom uses a custom control (OptionsCompositeControl) for the UI.
The ProvideProfile attribute is used to provide persistence for the package. The DesignerSerializationVisibility attribute is used to allow persistence for each property of the options page.
Get all samples
Clone the repo (How to):
git clone https://github.com/Microsoft/VSSDK-Extensibility-Samples.git
Run the sample
- To run the sample, hit F5 or choose the Debug > Start Debugging menu command. A new instance of Visual Studio will launch under the experimental hive.
- Once loaded, open the Options dialog window: Tools > Options
- A new category is available, titled: My Managed Options (C#)
- The new category contains two new pages: My Options, and Custom
Related topics