PART II
C h a p t e r 2 6 :
U s e S y s t e m . W i n d o w s . F o r m s
851
Text
is inherited from
Control
.
Next is the
Main( )
method, which is declared much like the
Main( )
methods found
throughout the rest of this book. It is the method at which program execution begins. Notice,
however, that it is preceded by the
STAThread
attribute. As a general rule, the
Main( )
method of a Windows program should have this attribute. It sets the threading model for the
program to a
single
-
threaded apartment
(STA). (A discussion of threading models and apartments
is beyond the scope of this chapter, but briefly, a Windows application can use one of two
different threading models: single-threaded apartment or multithreaded apartment.)
Inside
Do'stlaringiz bilan baham: |