System.Windows.Forms.Application Members

The members of System.Windows.Forms.Application are listed below.

See Also: Inherited members from System.Object

Public Properties

[read-only]
static
AllowQuitbool.

Gets a value indicating whether the caller can quit this application.

[read-only]
static
CommonAppDataPathstring.

Gets the path for the application data that is shared among all users.

[read-only]
static
CommonAppDataRegistryMicrosoft.Win32.RegistryKey.

Gets the registry key for the application data that is shared among all users.

[read-only]
static
CompanyNamestring.

Gets the company name associated with the application.

static
CurrentCultureSystem.Globalization.CultureInfo.

Gets or sets the culture information for the current thread.

static
CurrentInputLanguageInputLanguage.

Gets or sets the current input language for the current thread.

[read-only]
static
ExecutablePathstring.

Gets the path for the executable file that started the application, including the executable name.

[read-only]
static
LocalUserAppDataPathstring.

Gets the path for the application data of a local, non-roaming user.

[read-only]
static
MessageLoopbool.

Gets a value indicating whether a message loop exists on this thread.

[read-only]
static
OpenFormsFormCollection.

Gets a collection of open forms owned by the application.

[read-only]
static
ProductNamestring.

Gets the product name associated with this application.

[read-only]
static
ProductVersionstring.

Gets the product version associated with this application.

[read-only]
static
RenderWithVisualStylesbool.

Gets a value specifying whether the current application is drawing controls with visual styles.

static
SafeTopLevelCaptionFormatstring.

Gets or sets the format string to apply to top-level window captions when they are displayed with a warning banner.

[read-only]
static
StartupPathstring.

Gets the path for the executable file that started the application, not including the executable name.

[read-only]
static
UserAppDataPathstring.

Gets the path for the application data of a user.

[read-only]
static
UserAppDataRegistryMicrosoft.Win32.RegistryKey.

Gets the registry key for the application data of a user.

static
UseWaitCursorbool.

Gets or sets whether the wait cursor is used for all open forms of the application.

static
VisualStyleStateSystem.Windows.Forms.VisualStyles.VisualStyleState.

Gets a value that specifies how visual styles are applied to application windows.

Public Methods

static
AddMessageFilter(IMessageFilter)

Adds a message filter to monitor Windows messages as they are routed to their destinations.

static
DoEvents()

Processes all Windows messages currently in the message queue.

static
EnableVisualStyles()

Enables visual styles for the application.

static
Exit()

Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.

static
Exit(System.ComponentModel.CancelEventArgs)

Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.

static
ExitThread()

Exits the message loop on the current thread and closes all windows on the thread.

static
FilterMessage(ref Message) : bool
Documentation for this section has not yet been entered.
static
OleRequired() : System.Threading.ApartmentState

Initializes OLE on the current thread.

static
OnThreadException(Exception)

Raises the Application.ThreadException event.

static
RaiseIdle(EventArgs)

Raises the Application.Idle event in hosted scenarios.

static
RegisterMessageLoop(Application.MessageLoopCallback)
Documentation for this section has not yet been entered.
static
RemoveMessageFilter(IMessageFilter)

Removes a message filter from the message pump of the application.

static
Restart()

Shuts down the application and starts a new instance immediately.

static
Run()

Begins running a standard application message loop on the current thread, without a form.

static
Run(ApplicationContext)

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

static
Run(Form)

Begins running a standard application message loop on the current thread, and makes the specified form visible.

static
SetCompatibleTextRenderingDefault(bool)

Sets the application-wide default for the UseCompatibleTextRendering property defined on certain controls.

static
SetSuspendState(PowerState, bool, bool) : bool

Suspends or hibernates the system, or requests that the system be suspended or hibernated.

static
SetUnhandledExceptionMode(UnhandledExceptionMode)

Instructs the application how to respond to unhandled exceptions.

static
SetUnhandledExceptionMode(UnhandledExceptionMode, bool)

Instructs the application how to respond to unhandled exceptions, optionally applying thread-specific behavior.

static
UnregisterMessageLoop()

Unregisters the message loop callback made with Application.RegisterMessageLoop(System.Windows.Forms.Application.MessageLoopCallback).

Public Events

static
ApplicationExit

Occurs when the application is about to shut down.

static
EnterThreadModal

Occurs when the application is about to enter a modal state.

static
Idle

Occurs when the application finishes processing and is about to enter the idle state.

static
LeaveThreadModal

Occurs when the application is about to leave a modal state.

static
ThreadException

Occurs when an untrapped thread exception is thrown.

static
ThreadExit

Occurs when a thread is about to shut down. When the main thread for an application is about to be shut down, this event is raised first, followed by an Application.ApplicationExit event.