Countdown, the GUI Way
To put the icing on the cake for our running countdown example, let’s see what it takes to hook it up to a graphical user interface using our basic knowledge of Windows Forms.
Exploration of the various available controls is beyond the scope of this chapter, so you’ll have to take my word for it that appropriate controls are being used for the task at hand. We’ll keep the user interface as simple as we can, with a NumericUpDown control to select the number of seconds to countdown, a Button to start the timer, and a Label to display the current time. When the countdown has finished, a message box appears. Figure 18.26 shows the UI definition.
FIGURE 18.26 Countdown clock in Windows Forms.
Time to write some code! Double-click ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access