6.1. Our First Windows Forms Program

For our first Windows Forms program, we'll again greet the user, as we did in Chapter 1, except that this time we'll do it interactively through a graphical user interface (GUI). The initial window is pictured in Figure 6.1.

Figure 6.1. Initial Window

The window is represented as a Form class object. The title bar has been set to the string Hello, Windows Forms! As the user enters his or her name in the text box, we update the title bar to the text entered by the user. We do this through an event handler associated with the text box. The event is triggered whenever the content of the text box is altered. Within ...

Get C# Primer: A Practical Approach 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.