Chapter 18. Creating Windows Applications

All the previous chapters have used console applications to demonstrate the C# language. This allowed us to focus on the language itself, without being distracted by more complicated issues such as windows, mice, and controls.

That said, the only reason most people learn C# is to create Windows applications or web applications, or both. On the following pages, you will learn how to create Windows applications using the tools provided by Visual Studio (the next chapter shows you how to create web applications).

The application you will create in this chapter will bring together a number of C# techniques shown in earlier chapters and apply them to solving a real-world problem.

Creating a Simple Windows Form

The .NET Framework offers extensive support for Windows application development, the centerpiece of which is Windows Forms. The metaphor of a “form” was borrowed from Visual Basic, and is a hallmark of Rapid Application Development (RAD ). Arguably, C# is the first development environment to marry the RAD tools of VB with the object-oriented and high-performance characteristics of a C++/Java-like language (though, of course, C# and Visual Basic 2005 are now virtually the same language with different syntactic coatings).

Using the Visual Studio Designer

While it is possible to build a Windows application using any text editor, and it is possible to compile from the command line, it is senseless to do so. Visual Studio 2005 increases ...

Get Learning C# 2005, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.