Click here to Skip to main content
15,885,141 members
Articles / Desktop Programming / Windows Forms
Article

C# Templates for Visual Studio 2003

Rate me:
Please Sign up or sign in to vote.
2.87/5 (7 votes)
18 Oct 2005CPOL2 min read 59K   532   15   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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralError: file not found when download template Pin
nguyen hoang minh13-Oct-05 5:25
nguyen hoang minh13-Oct-05 5:25 
GeneralRe: Error: file not found when download template Pin
miklovan13-Oct-05 16:30
miklovan13-Oct-05 16:30 
GeneralRe: Error: file not found when download template Pin
miklovan13-Oct-05 16:42
miklovan13-Oct-05 16:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.