1 TaskScheduler uiScheduler = TaskScheduler.FromCurrentSynchronizationContext(); 2 Task.Factory.StartNew(() => { 3 txtLog.Text=DateTime.Now.ToString(); 4 txtLog.ScrollToEnd(); 5 }, CancellationToken.None, TaskCreationOptions.None, uiScheduler);