Windows

The basic element of most GUI programming in Windows Forms is the window. Essentially, everything on a GUI screen—buttons, text boxes, and icons—are windows. Because of this, most of the windows and controls in the Windows Forms package have the same characteristics. For instance, they all have a Text property. How they use the property is up to the specific type of window.

Building a Windows Forms application is easy once a few basic concepts are understood. This section covers some of these concepts and provides a starting point from which to proceed. Listing 16.1 shows a relatively simple Windows Forms application. To compile the code in Listing 16.1, use the command line in Listing 16.2.

Listing 16.1. A Simple Windows Forms Application ...

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