Seven Segment Countdown Timer

Sometimes the inspiration for funny little applications induces as much laughter as the application itself. Although, in my experience, often these inspirations seem ridiculous to the point that I never sit down to turn inspiration into implementation. Yesterday I experienced one of these moments and actually forced myself to sit down and author the attached application.

As you may know, the final release date of the WCF product approaches. Each morning we have a cross feature team meeting to track progress against a couple of upcoming dates. Until this morning, these meetings opened with an unsent email on the screen giving the number of days left until these dates. Yesterday, some rich formatting was added (read bold text) with a joke that the next day would add color. I jokingly asked when would someone write a web page with a count down timer. Laughter ensued, but my brain refused to let the idea go. Boom – inspiration.

That afternoon, I put aside 30 minutes and wrote the attached .NET 2.0 WinForms application in C# that emulates seven segment display count down timers. At first, I hard coded the two dates important to the WCF product. However, that quickly became too restrictive as my wife asked me to add an additional date important to us. This led to adding functionality to add and remove additional timers. To keep it simple, I decided to persist the timers in the application’s AppSettings section of the app.config file.

I do not write many WinForm applications, but each time I do I find myself pleasantly surprised with how easy .NET makes the process. My new favorite control: FlowLayoutPanel. Combined with Form.AutoSize = true, and AutoSizeMode = GrowAndShrink, this control makes dynamic control content (in my case, number of countdown timers) super simple.

I almost forgot how much I enjoy writing small, fun applications. An unfortunate, potentially not uncommon, side affect of writing software professionally. Hopefully my experience with this little app reminds me to take some time each week to work on some personal project just for fun. If you have not written a small application (less than 100 lines of code, not counting auto generated lines) recently, I highly recommend it. Along with helping to keep your skills sharp, it reminds us why we do this professionally in the first place.

Mark Gabarra

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm

 

SevenSegmentCounter.zip