Skip to content

Added step to open custom options page #8362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/extensibility/creating-an-options-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,29 @@ This walkthrough creates a simple Tools/Options page that uses a property grid t

A message box displays the current value of `OptionInteger`.

## Open options page

In this section, you'll add a Command and an event for the button to open the options page

1. First add a file called OpenPageCommand.cs.

3. Then, open *OpenPageCommand.cs* and change your Execute method.

```csharp
private void Execute(object sender, EventArgs e)
{
ThreadHelper.ThrowIfNotOnUIThread();
Type optionsPageType = typeof(OptionPageCustom);
Instance.package.ShowOptionPage(optionsPageType);
}
```

3. Run the project, then click the Invoke button (it is under the Tool option by default), then you can see your options page is opened.

5. More details about opening options page can refer to the following documents

- [Opening an Options Page](/previous-versions/cc826083(v=vs.140))

## See also

- [Options and options pages](../extensibility/internals/options-and-options-pages.md)