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
Code snippets are highly customizable code fragments intended to accomplish simple to intermediate tasks quickly; they can be inserted into your code with just a few keystrokes. You can insert IntelliSense Code Snippets using the Code Snippet Picker or typing the shortcut name of the snippet and pressing Tab.
On the menu bar, choose Edit > IntelliSense > Insert Snippet. From the right-click or context menu in the code editor, choose Snippet > Insert Snippet.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With