Many of the examples C# Windows Forms programs posted off the class page are a single source file (*.cs) or a source file with some resources (*.gif or *.htm documentation files.

There are two ways you can run these examples.

Using Microsoft's Visual Studio.NET 2003. This example describes how to build the Hello585 example.

  1. Create a new visual studio .net 2003 C# Windows Application. (e.g., Hello585 on the desktop)
  2. Right click on the *.cs file links off the class page, select save target as, be sure you have text file (not html file) selected as the file filter. Save the *.cs files in the directory you have created for the C# Windows Application. (e.g., Hello585.cs and Author.cs)
  3. From the Visual Studio .NET Project menu select add existing item. Select the *.cs files you wish to add to the project. (e.g., You now have Author.cs, Form1.cs, and Hello585.cs in your Hello585 project -- you can see this by opening the Solution Explorer window).
  4. Remove the Form1.cs file if it is not needed, or was not copied from the class page example. (e.g., it is not needed here -- it was automatically created when the new Windows Application project was created. If the example has a Form1.cs file you do not want to remove it. You should see the file's name when you save it.) You can do this by selecting the file in the solution explorer window and right clicking then selecting "exclude from project". Or you can select it in the solution explorer and then use the Project memory to select "exclude from project". (e.g., now you have Author.cs and Hello585.cs files in the project).
  5. From the Build menu select "build", or "rebuild".
  6. From the Debug menu select "Start without debugger". This option will also cause the source file to be rebuilt if it has been changed.