❔ c# wpf textbox access violation
Hello does anyone know how can i edit the TextBox1.Text within the Task.run so i don't have an access violation ? here is the code :
3 Replies
you can only edit the control on the UI thread, the Task.Run takes you to a different thread so it won't work. you can "come back" to the UI thread temporarily with
Dispatcher.Invoke
(though, if i may, i would suggest:) Thanks it worked
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.