Asynchronous Windows
Forms Programming
Windows Forms applications often require some sort of
asynchronous invocation option.
You rarely want to block the user interface while a lengthy
operation is executed in the background. Windows Forms poses
a set of complicated design and implementation issues when it
comes to asynchronous method invocation and multithreading
due to the underlying Windows messages processing.
Although .NET does provide a uniform asynchronous invocation
mechanism (described in my article “Asynchronous .NET
Programming”, CoDe Magazine, May 2003) you cannot apply it
as-is in a Windows Forms application. To address this problem,
the next version of .NET (version 2.0 code-name Whidbey)
provides a new component designed to ease the task of
developing asynchronous Windows Forms applications. This
article starts by describing the current asynchronous
programming model available to Windows Forms developers.
Then not only does it describe the Whidbey solution, it also
provides a .NET 1.1 implementation of it, so that you could take
advantage of its superior programming model today and ease
the transition into Windows Forms 2.0 in the future.
Windows Forms 1.1 and
Asynchronous Execution
! !
" #$% !#$%
&"
" & #$%
"&
'"
"& ())
"&"$
( ) ""
* + ""%
* "
"& !
"&!#$%
"",
'"
"-."
#$%"
&
" &
& " /
0 ""& ,"
* +
+&""