kenwarner
kenwarner

Reputation: 29120

How to complete a Visual Studio snippet in VB.NET?

In C# if you start a snippet you press Tab to cycle through the snippet elements, and press Enter to complete and exit the snippet.

In VB.NET you still use Tab to cycle through the snippet elements, but how do you end the snippet? Enter doesn't work and I can't figure out the correct keyboard shortcut

Upvotes: 7

Views: 1221

Answers (2)

bstoney
bstoney

Reputation: 6784

VB snippets don't work the same way as C# snippets. VB snippets don't have an 'end' and instead stay active until you start typing outside of the snippet scope. The best method is to press esc (once or twice depending on your current selection) and then use the arrow keys to navigate.

A great demo video is available on MSDN. It focusses mostly on C# but has some explanation of the VB snippets at the end.

For more information check out the keybinding posters

Upvotes: 3

Dan Tao
Dan Tao

Reputation: 128347

Enter doesn't work? It's always worked for me when, for example, I add a new line after the end of the snippet. Alternately, you should be able to end a snippet just by navigating somewhere else in the code and typing (or deleting) something.

Upvotes: 1

Related Questions