Skip to content

Commit 1a3b1da

Browse files
authored
Added step to open custom options page
I found this step missing in newer versions of MSDN searches, so it's bothering me a bit, I'm hoping to add it here or somewhere else
1 parent 525e2d5 commit 1a3b1da

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/extensibility/creating-an-options-page.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,29 @@ This walkthrough creates a simple Tools/Options page that uses a property grid t
265265

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

268+
## Open options page
269+
270+
In this section, you will add you will add a Command and an event for the button to open the options page
271+
272+
1. First add a Comman called OpenpageCommand.cs.
273+
274+
3. Then open OpenpageCommand.cs and change your Execute method.
275+
276+
```csharp
277+
private void Execute(object sender, EventArgs e)
278+
{
279+
ThreadHelper.ThrowIfNotOnUIThread();
280+
Type optionsPageType = typeof(OptionPageCustom);
281+
Instance.package.ShowOptionPage(optionsPageType);
282+
}
283+
```
284+
285+
3. Run the project, then click the Invoke XXX button (it is under the Tool option by default), then you can see your options page is opened
286+
287+
5. More details about opening options page can refer to the following documents
288+
289+
- [Opening an Options Page](https://docs.microsoft.com/en-us/previous-versions/cc826083(v=vs.140))
290+
268291
## See also
269292

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

0 commit comments

Comments
 (0)