Update Controls While Enabling Others
-
I need to update certain controls on a form in C# while a test sequence is performed that lasts up to 90 seconds while keeping a running record on that same form of the test results. Basically, the top half of the form will be the data entry portion of the form with the relevant text and combo boxes while the bottom portion of the form contains the data being tested. Certain labels and text boxes on the bottom part of the form need to be updated as the test progresses, but I need to enable the user to enter new data in the top half of the form. I thought perhaps multi-threading would solve the trick, but would the threads be able to access the same resource, this one form, at the same time?
-
I need to update certain controls on a form in C# while a test sequence is performed that lasts up to 90 seconds while keeping a running record on that same form of the test results. Basically, the top half of the form will be the data entry portion of the form with the relevant text and combo boxes while the bottom portion of the form contains the data being tested. Certain labels and text boxes on the bottom part of the form need to be updated as the test progresses, but I need to enable the user to enter new data in the top half of the form. I thought perhaps multi-threading would solve the trick, but would the threads be able to access the same resource, this one form, at the same time?
Multi-threading *will* solve the problem. You just need to read a bit about synchronizing access to shared resources. There are many articles on the internet that cover this topic. Take a look at this article: http://www.c-sharpcorner.com/Code/2002/April/MultithreadingP3.asp[^] and then do a search for "C# thread synchronization". -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall