- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
- DispatcherTimer dispatcherTimer = new DispatcherTimer();
- dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
- dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
- dispatcherTimer.Start();
- }
- private void dispatcherTimer_Tick(object sender, EventArgs e)
- {
- listBox1.Items.Add(DateTime.Now.Hour.ToString() + ":" +
- DateTime.Now.Second.ToString());
- CommandManager.InvalidateRequerySuggested();
- listBox1.Items.MoveCurrentToLast();
- listBox1.SelectedItem = listBox1.Items.CurrentItem;
- listBox1.ScrollIntoView(listBox1.Items.CurrentItem);
- }
Multi-coloured code for a blog http://aivolkov.ru/online-syntax-highlighter/
No comments:
Post a Comment
Note: only a member of this blog may post a comment.