34

When user the "Implement Inteface X" context menu feature, the inserted code gets surrounded by a

#region [interfacename] Members
#endregion

pair. I always end up deleting this, is there a way I can permanently turn it off? I had a quick search through the snippets directory, but wasn't sure if this was the right place. There's pp_region.snippet that I guess I could modify, but I got the feeling that would turn off the #region/#endregion completely. I thought I'd ask here before I go doing things that will have me re-installing VS...

0

2 Answers 2

43

You can turn it off via Tools / Options

Then, in the option-window, you select 'Text Editor', then the language of your choice (C# for ex). Then, you select 'Advanced', and then, you have a checkbox which says: 'Surround generated code with #region'

0
1

Also, if you're using Resharper you can fully configure the layout of your classes so they'll look exactly the way you want. One of the options is to completely remove the region tags whenever it finds any. It's awesome to open any c# project and have it reformatted just by doing [CTRL+E, C]

2
  • 2
    Sorry, but I cannot bear Resharper. One day I'll be able to install it and it won't: remap all my keybindings and refuse to set them back; screw up all the Intellisense and refuse to change it back; make my machine run like a dog and refuse to uninstall. I'm not a fan :-)
    – endian
    Commented Jan 21, 2009 at 9:18
  • 2
    I used to feel like that about ReSharper - but one day I bit the bullet, and spent a few weeks configuring it and learning the shortcuts etc. It has seriously changed the way I develop; I'm much more productive now :)
    – Spikeh
    Commented Dec 31, 2012 at 8:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.