Surround With in C#

As I mentioned in yesterday’s article entitled Inserting snippets in C# you can also insert snippets around existing code. To do this you need to use the Surround With option.

These snippets can be accessed on the design page (where you will receive snippets of HTML and ASP.NET code) or from the code behind page where you can get C# snippets.

You can access these snippets in several ways:

  • Highlight the text that you want the snippet to surround, right-click and select Surround With
  • Highlight the text that you want the snippet to surround and hit CTRL+K, CTRL+S, The same dialog box as above appears
  • Highlight the text that you want the snippet to surround and on the Menu Bar browse to Edit–>Intellisense–>Surround With
Advertisements

About Ken Cenerelli
I am a Programmer Writer, .NET Developer, Microsoft MVP - Visual Studio and Development Technologies, Public Speaker, Blogger, and Microsoft Azure Nerd. I blog regularly at kencenerelli.wordpress.com and can be found on Twitter via @KenCenerelli.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: