Project Description
Keep track of time spent on your projects with this C# Windows forms application that includes fully-commented source code. It runs from your system tray and makes it easy to punch in and out and view totals. (MSDN Coding 4 Fun)


Time and how we use it is a matter of great importance to many people. I am certainly no exception, frequently working on two to five projects at a given time. Whether it's just being curious about how much time you are spending on various classes at school, or billable projects, time tracking can be tedious. Do you use a paper notebook (remember those)? Do you create a spreadsheet in Excel? What about a custom time accounting software package? For this project, I decided it would be good to create a basic time tracking tool to sit quietly in the system tray.


Just double-click the executable and the icon will appear in the notification area (the system tray).

ScreenCapture_01 2009.04.14 00.04.jpg

Right-click the icon in the system tray to view the menu. You can add projects, punch in/out, punch out at a specific time (like ten minutes ago when you should have punched out...) or view settings.

ScreenCapture_02 2009.04.14 00.05.jpg

Click Add Project to enter the name for a project. Then you can simple double-click the icon to sign in or out. The tooltip always shows you in or out, in addition to the icon overlay. When you are ready to do some accounting, view the details:

ScreenCapture_03 2009.04.14 00.06.jpg

There isn't any way to export this information, but it wouldn't be that difficult to extend. All data is held in a DataTable serialized as XML. It would be a great challenge to extend this with the Microsoft ReportViewer control to create some cool output options.

Finally, you can enable or disable projects (just to cull down your list of inactive projects) in the second tab:

ScreenCapture_04 2009.04.14 00.06.jpg

If you want commit permission to improve this, please let me know. It's served me well and can be even better.

This project has been tested up to Windows 7 RC1.

This sample application was originally published as part of the MSDN Coding 4 Fun article Keeping Track of Time.

Last edited Apr 14, 2009 at 5:16 AM by atkulp, version 2