Ещё одни электронные часы, только теперь на WPF. Всё делается намного прощё, хотя впринципе и в Win Form можно было бы сделать так же.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Windows.Threading; namespace MyTimer { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { DispatcherTimer timer; public MainWindow() { this.InitializeComponent(); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1.0); timer.Start(); timer.Tick += new EventHandler(delegate(object s, EventArgs a) { tb.Text = "" + DateTime.Now.Hour +":" + DateTime.Now.Minute +":" + DateTime.Now.Second; }); } } }