I keep getting
Cross-thread operation not valid: Control 'keyholderTxt' accessed from a thread other than the thread it was created on.
on different controls in different forms of the project, and I found it googled and found a lot of answers on how to access materials from different streams, but as far as I know, I do not use any other streams in my project, and change hundreds of possible places in the code will be unmanageable.
This has never happened, only since I added another code that seems unrelated. I include a sample of places where I get errors below, but this has happened in many places around the solution.
keyholderTxt.Text = "Keyholders Currently In:\r\n \r\n Nibley 1: + keyholders";
or this is a better example, as you can see everything that happens from loading a form to an error:
private void Identification_Load(object sender, System.EventArgs e) { _Timer.Interval = 1000; _Timer.Tick += new EventHandler(_Timer_Tick); _Timer.Start(); txtIdentify.Text = string.Empty; rightIndex = null; SendMessage(Action.SendMessage, "Place your finger on the reader."); if (!_sender.OpenReader()) { this.Close(); } if (!_sender.StartCaptureAsync(this.OnCaptured)) { this.Close(); } } void _Timer_Tick(object sender, EventArgs e) { this.theTime.Text = DateTime.Now.ToString(); } private void OnCaptured(CaptureResult captureResult) { txtIdentify.Clear();
Can things like not closing datareaders cause such an error?
I am using a Windows Forms application.
source share