In The Hand LtdIn The Hand
IsSingleInstance Property
NamespacesInTheHand.Windows.FormsApplicationHelperIsSingleInstance
.NET Components for Mobility
Allows you to enforce a single instance application on platforms other than Windows Mobile.
Declaration Syntax
C#Visual Basic
public static bool IsSingleInstance { get; set; }
Public Shared Property IsSingleInstance As Boolean
	Get
	Set
Remarks
On generic Windows CE platforms the .NET Compact Framework does not enforce a single instance of your application. If you want to override this behaviour and provide a behaviour to match Windows Mobile then set this property to true in your startup (e.g. static void Main()) procedure before Application.Run is called. If a second instance of the application is created it will be closed and the initial instance will be brought to the foreground.
Examples
CopyC#
using InTheHand.Windows.Forms;

[MTAThread]
static void Main()
{
    ApplicationHelper.IsSingleInstance = true;
    Application.Run(new Form1());
}
Exceptions
ExceptionCondition
PlatformNotSupportedExceptionProperty is readonly on Windows Mobile (and will always return true).

Assembly: InTheHand.Windows.Forms (Module: InTheHand.Windows.Forms) Version: 7.0.0.0