I have a simple application that is using async / await (.NET 4.0 with async targeting package) to communicate with a db and return result.
I need to alter the behavior of some form elements until the data are available. For simple implementations i would like to disable form elements until the data are available. Or change the behavior of the click events on form elements.
What is the proper way of doing it?
I have thought of
- Having some boolean property to let the elements know that the thread is operating.
- Use eventing form the button that does the work? (I suspect this is the solution but please elaborate on how)
Thanks.
This should be as simple as the code we saw in your other question. Logically you want:
Now you can make that a lot simpler if you put all the controls that need this treatment together: