Visual Studio Development Bookmark and Share   
 index > Visual Studio WPF Designer > C# Newbie -- Trying to build an on-screen count-up or count-down timer displayed in a WPF form ...
 

C# Newbie -- Trying to build an on-screen count-up or count-down timer displayed in a WPF form ...

Well, I'm STILL a C# newbie! Sometimes, I think I'm going backwards!

Can someone point me to some C# code for the code-behind plumbing on a small WPF form that displays a count-up or count-down timer?

This is a very simple need. I just want the user to be able to launch a small on-screen form with controls that allow him to start atimer that showselapsed timein "HH:MM:SS" format. It would also be nice to allow the user to simply type in an amount of time and then click the [Start] button to start a count down with an audio and visual alert at the end of the specifiedtime.

I have been searching forsome sample codeon-and off for several weeks but I have not yet found code that makes sense for what I want to do -- which is incredibly simple in VBA but apparently a bit more complex in C#, especially if the Timer needs to run on a different thread (which may or may not be required). Most of what I have found is code designed for doing performance timing on applications.

Any advice on this will be most appreciated.

Thanks,

Mike7491  Friday, June 26, 2009 5:02 PM

Mike,

Please post this programming question on the WPF Forum here:

http://social.msdn.microsoft.com/forums/en-US/wpf/threads/



Cheers, Karl - Microsoft Product Team, Code Project MVP - http://karlshifflett.wordpress.com/
karl140.6  Wednesday, August 26, 2009 4:35 PM

You can use google to search for other answers

Custom Search

More Threads

• Install problem?
• change datatemplate when user selected Value in ComboBox
• An unspecified error occurred on the render thread.
• Adding WPF controls from referenced projects to toolbox
• WPF Designer failing to load in Windows 7 (x64)
• Custom controls in Cider?
• FlowDocument and RichTextBox
• Web UI Automation Testing
• Get EditingContext on InitializeDefaults
• WPF how to add a control to a custom control during design time