Chapter 18. Creating Windows Applications

All of 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 being said, for many people the only reason to 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. Chapter 19 will show you how to create visually rich applications using the Windows Presentation Foundation (WPF), which was introduced in .NET 3.0.

Windows application programming is a complicated topic that can occupy an entire book in itself—in fact, Programming .NET Windows Applications, by Jesse Liberty and Dan Hurwitz (O’Reilly), is one of those books. Windows programming is one of the most advanced topics we’ll cover in this book. Therefore, this will be something of a whirlwind tour. This chapter is also something of a culminating project, however, as you’re going to see a number of techniques that you’ve learned in recent chapters, such as event handlers, generics, collections, and of course, the more basic elements of the language that we’ve been using throughout the book.

In this chapter, you’ll be creating the most complex application you’ve written so far. It’s a Windows application that will allow you to copy files from one location on your computer to another. It ...

Get Learning C# 3.0 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.