I want add text to RichTextBox that not freeze or crash my program. When I use:
await Task.Run(()=> rtb.AppendText("This is a test"));
I get error:
The calling thread cannot access this object because a different thread owns it
So how can I fix it?
And I saw this:
Adding text to RichTextBox Async #C / WPF
More info: I forgot to add that I am adding more than 30k information from txt to database, so when every information exist I want to add it to RichTextBox that exist in database.
Before removing or closing my question, I searched a lot in Google and I can't find any solution for my problem.