ApplicationContext

ApplicationContext

System. Windows .Forms (system. windows .forms.dll) class

Normally, you call Application.Run() , passing in the Form you wish to use as the MainForm of the application. An alternative is to use this class, which then allows you to control several features, including starting the message loop (again, optionally with a MainForm ), stopping the message loop, and handling ThreadExit events related to the application terminating. You can also override the OnMainFormClosed() method to determine whether the message pump is terminated when the main form is closed.

 public class  ApplicationContext  {  // Public Constructors  public  ApplicationContext  ();    public  ApplicationContext  (Form  mainForm  );  // Public Instance Properties  public Form  MainForm  {set; get; }  // Public Instance Methods  public void  Dispose  ();    public void  ExitThread  ();  // Protected Instance Methods  protected virtual void  Dispose  (bool  disposing  );    protected virtual void  ExitThreadCore  ();    protected override void  Finalize  ();  // overrides object  protected virtual void  OnMainFormClosed  (object  sender  , EventArgs  e  );  // Events  public event EventHandler  ThreadExit  ; } 

Passed To

Application.Run()



. Net Windows Forms in a Nutshell
.NET Windows Forms in a Nutshell
ISBN: 0596003382
EAN: 2147483647
Year: 2002
Pages: 794

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net