Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Accessing controls from threads
I hope some one that give me a nice clear answer to this as I'm at my ends whits with it.
Ok I have form1 and a button on that opens form2. Form2 starts a thread that will create report for me. When the threads start it executes some code that accesses controls on form1. Of course you know this wouldn't work because I'm getting errors as its unsafe. The code is very simple
if form1.checkbox.checked then
' Do something
I have many checkboxes on form1 that I need to check so is there a way I can do this from the thread quickly and safely?
I also calls a public function in the thread that is in form1 that adds data to a tree view.