Creating a Windows Forms Application


Creating a Windows Forms application is a fairly simple process. You start off by opening Visual Studio 2005 and choosing to create a new project. After selecting the appropriate language from the left side of the project creation dialog (assuming you have more than one language installed), click the Windows tree node. The following project types will appear:

  • Windows Application Creates an empty Windows application with an empty form.

  • Class Library Creates an assembly that contains a library of classes. You have created many of these throughout the course of this book.

  • Windows Control Library Creates an assembly that is designed to contain a library of custom Windows Forms controls.

  • Windows Service Creates an executable application without any user interface with the appropriate code and hooks to run as a service within the Services Control Panel.

  • Console Application You have created countless console applications if you have been following along throughout this book; creates an executable application that utilizes the Windows Command Prompt console for input and output.

You also might see some additional project types depending on your Visual Studio installation, but the ones listed here are the ones that apply to Windows Forms programming.

To create your first Windows Forms application, click on the "Windows Application" template, provide a name for the application and a location for your code, and click OK to continue. Most of what is presented to you should seem quite familiar. Rather than having the Web Forms Designer window allowing you to build your web application, you have an image of an empty form and a Toolbox full of Windows Forms tools that looks something like the image shown in Figure 34.2.

Figure 34.2. An empty Windows Forms application.


The next section will teach you the basics of building a powerful user interface using the Windows Forms Designer.



Microsoft Visual C# 2005 Unleashed
Microsoft Visual C# 2005 Unleashed
ISBN: 0672327767
EAN: 2147483647
Year: 2004
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net