Shortcut Element (IntelliSense Code Snippets)
Specifies the shortcut text used to insert the snippet.
<Shortcut>
Shortcut Text
</Shortcut>
To use the text value of the Shortcut element to insert a Visual Basic code snippet, type the shortcut value in the Code Editor, and press the TAB key. For example, to insert a code snippet with a Shortcut element value of MySnippet, type MySnippet into the Code Editor and press the TAB key. For more information, see How to: Insert Snippets Into Your Code (Visual Basic).
Note |
|---|
| In Visual Basic projects, you can type the first few letters of the shortcut name followed by a question mark (?), and press TAB to see a list of all snippet shortcuts that begin with those letters. |
To use the text value of the Shortcut element to insert a Visual C# or Visual J# code snippet, type the shortcut value in the Code Editor, and press the TAB key twice. For example, to insert a code snippet with a Shortcut element value of MySnippet, type MySnippet into the Code Editor and press the TAB key twice. For more information, see How to: Use Code Snippets (C#).
If two code snippets contain the same Shortcut element value, a disambiguator box will open after you type the shortcut and press the TAB key, allowing you to select the correct code snippet.
The Shortcut element in the following example has a value of copyfile. To insert this code snippet, type copyfile in the Code Editor and press the TAB key.
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Copy File</Title>
<Author>Microsoft Corporation</Author>
<Description>Copies a file and saves it as another file.</Description>
<HelpUrl>www.microsoft.com</HelpUrl>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Keywords>
<Keyword>File copying</Keyword>
<Keyword>Copying files</Keyword>
</Keywords>
<Shortcut>copyfile</Shortcut>
</Header>
<Snippet>
<!-- Insert snippet information here -->
</Snippet>
</CodeSnippet>
</CodeSnippets>
Note