Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

C# Templates for Visual Studio 2003

0.00/5 (No votes)
18 Oct 2005 3  
This article contains new templates for Form, Control and Class creation in C# which are more compactly formatted. It also gives an idea of how to edit the templates yourself.
Sample Image - VSTemplates1.png

Introduction

All information in this article refers to Visual Studio 2003. Sorry, I don't have Visual Studio 2002 anymore, but I believe its template system is pretty much similar to Visual Studio 2003.

When I first began to code in Visual Studio in 2002, I loved it from the first sight. Its IDE is comfortable and productive and you quickly get used to it. It has, however, some minor inconveniences, for me at least. One of them is a verbose and bulky designer auto generated code.

One day, after straightening up the auto generated code for the nth time, I've finally decided to do something about it. It appeared to be very easy. So I have corrected the templates, which I use most often, namely Form, User Control, Custom Control and Class. And after using them for over a year, I decided to share the templates set with the guys who, like me, do not like standard templates, but who haven't yet lost their patience enough to do something about it. :)

Installation

If you have the default installation path for Visual Studio, you will find the templates lying in C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards directory.

I have packed the template files with all the directory structure up to Microsoft Visual Studio .NET 2003. So you have to unpack the VSTemplates_set.zip file to current directory. It will create a directory called Microsoft Visual Studio .NET 2003. Copy this dir to C:\Program Files. You will be asked to overwrite some files. Agree. Do this is at your own risk, although there is hardly any risk at all. Backup VC#Wizards directory if you want to save your old templates.

After that, if you will start a new project or add a new form or class to an existing project, you will have all auto generated code neatly packed in one region, leaving only the constructor outside.
I am working with new templates for over a year, and I have given them to a couple of friends, and so far no problem has occurred.

If you don't like my templates either, you will at least have the idea where to search for them and you can always edit them as you want them to be.

Further Reading

Surfing through The Code Project after submitting the article, I found that there are a lot of more detailed and profound articles on Visual Studio templates customization. Still this article can be a good starter and should you require further information, just follow the links below:

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here