We all know that calling the Application.DoEvents()
method causes the current thread to be suspended while all waiting window messages are processed. If a message causes an event to be triggered, then other areas of the application code may execute. This can cause the application to exhibit unexpected behaviors that are difficult to debug. Also it has been advised to perform long and heavy operations or computations that take a long time on a new thread, but it seems, it will be useful to create a method (or an extension one!) using a filter for released messages for GUI controls to be able to simulate Application.DoEvents() for any arbitrary of them only. (i.e. to have a method like: myControl.DoEvents()
)
Do you have any idea about creating such a method?