Short cut for "SurroundWith" code snippets in Visual Studio .NET
By Indranil Chatterjee
Often we need to surround an existing set of lines of code within a block (e.g. try, using, for foreach etc.). Visual Studio provides short cuts to enable that.
Select the relevant section of code and press the key combination CTRL + K,S from the "Surround With:" context menu that appears, select "Visual C#" (or any other relevant category), select the relevant snippet (e.g. for, foreach,
using etc.) and hit Enter. Your code will get wrapped by the relevant block.
Short cut for "SurroundWith" code snippets in Visual Studio .NET (615 Views)