private void TextBox1_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) { // 在此处添加事件处理程序实现。 ScrollViewer1.ScrollToEnd(); }
private void log(string msg) { textBlock1.Dispatcher.Invoke(new Action(() => { textBlock1.Text += GetTimeNow() + msg + "\n";; })); ScrollViewer1.Dispatcher.Invoke(new Action(() => { ScrollViewer1.ScrollToEnd(); })); }
public void Log(string msg) { textBlock1.Dispatcher.Invoke(new Action(() => { textBlock1.Text += Time() + msg + "\n";; })); ScrollViewer1.Dispatcher.Invoke(new Action(() => { ScrollViewer1.ScrollToEnd(); })); }