I setup a form (subform) inside another form (mainform)at runtime. While some methods are being executed, the data in this subform also gets updated. However, I can not do anything else in the mainform. I have also tried setting the subform up as a control but I have the same problem. Is there a way I can access the mainform while the subform is updating.
I presume the process going on in the subform is reading from the database or some other long running process. This long running process needs to be separated onto another thread (backgroundworker thread is a good place to start.) This allow the UI on the main thread to respond.
Never underestimate the power of human stupidity
To add to Mycroft's answer, all long running operations should be done on a separate thread to the UI. The problem with that is you cannot update the UI from a different thread.
The BackgroundWorker[^] component is a perfect fit for this situation as it's ProgressChanged and RunWorkerCompleted events will be raised on your UI thread so that problem is solved, and the DoWork event is raised on the worker thread so you don't have to get involved any more than that.
If you need to pass data around then the various methods/event arguments have an object you can use, alternatively I made a generic version which you can find here[^].