This documentation is archived and is not being maintained.

Application.Run Method (ApplicationContext)

.NET Framework 1.1

Begins running a standard application message loop on the current thread, with an ApplicationContext.

[Visual Basic]
Overloads Public Shared Sub Run( _
   ByVal context As ApplicationContext _
public static void Run(
 ApplicationContext context
public: static void Run(
 ApplicationContext* context
public static function Run(
   context : ApplicationContext


An ApplicationContext in which the application is run.


Exception Type Condition
InvalidOperationException A main message loop is already running on this thread.


The message loop runs until Exit or ExitThread is called or the ThreadExit event is raised on the context object.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Application Class | Application Members | System.Windows.Forms Namespace | Application.Run Overload List | Exit | ExitThread | DoEvents