Learning by Example—ThreadedTimer

This sample application is simple in nature. It illustrates some of the basic threading concepts that we have talked about to this point by creating two explicit threads. One thread continuously displays the current system time onto the form. The other thread continuously “monitors” the timer thread, reporting its current state out to a list box. The form also exposes a few buttons that allow you to play with the timer thread by starting it, sleeping it, suspending it, or aborting it (see Figure 12.8).

Figure 12.8. Window—ThreadedTimer application.

This program is primarily an educational exercise to see how the ...

Get Visual Basic® Programmer's Guide to the .NET Framework Class Library 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.