If you’re developing a winforms application with VB.NET you can set a checkbox in the designer to have a single instance application. This option is not available to C# developers but since language does not matter in the .NET space you can just use the same classes the VB.NET designer uses.
By subclassing WindowsFormsApplicationBase you can get the same behaviour. The class can be found in the Microsoft.VisualBasic.ApplicationServices namespace.
public class SingleInstanceManager : WindowsFormsApplicationBase { public SingleInstanceManager() { IsSingleInstance = true; EnableVisualStyles = true; ShutdownStyle = ShutdownMode.AfterMainFormCloses; } protected override bool OnStartup(StartupEventArgs e) { return true; } protected override void OnCreateMainForm() { base.OnCreateMainForm(); MainForm = new MainForm(); HideSplashScreen(); } protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { base.OnStartupNextInstance(eventArgs); MainForm.Focus(); } protected override void OnCreateSplashScreen() { base.OnCreateSplashScreen(); SplashScreen = new SplashForm(); } }
Change your Program.cs to use this new class.
[STAThread] static void Main() { var manager = new SingleInstanceManager(); manager.Run(new string[]{}); }
Tags: winforms

buy@generic.VIAGRA” rel=”nofollow”>……
Need cheap generic VIAGRA?…
buy@generic.LEVITRA” rel=”nofollow”>……
Need cheap generic LEVITRA?…
Order@Cheap.Abana” rel=”nofollow”>..…
Buynow it…
Buy@Abilify.Online” rel=”nofollow”>..…
Buygeneric meds…
Buy@Cheap.Abilify” rel=”nofollow”>..…
Buynow it…
Purchase@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>.…
Buynow it…
Order@Generic.Acai” rel=”nofollow”>..…
Buywithout prescription…
Purchase@Cheap.Abilify” rel=”nofollow”>……
Buywithout prescription…
Get@Abilify.Online” rel=”nofollow”>..…
Buyit now…
Buy@Cheap.Acai” rel=”nofollow”>.…
Buywithout prescription…
Order@Acai.Online” rel=”nofollow”>……
Buynow it…
Order@Acai.Online” rel=”nofollow”>……
Buyit now…
Purchase@Discount.Acai” rel=”nofollow”>……
Buygeneric drugs…
Cheap@Acai.Online” rel=”nofollow”>……
Buynow…
Purchase@Discount.Energy.Boost” rel=”nofollow”>.…
Buynow it…
Buy@Cheap.Accupril” rel=”nofollow”>.…
Buygeneric meds…
accutane@for.sale” rel=”nofollow”>.…
Buygeneric drugs…
Buy@Cheap.Aciphex” rel=”nofollow”>.…
Buygeneric meds…
Cheap@Actonel.Without.Prescription” rel=”nofollow”>……
Buynow it mou…
Purchase@Cheap.Acular” rel=”nofollow”>..…
Buygeneric meds qmo…
Order@Cheap.Adalat” rel=”nofollow”>..…
Buygeneric drugs lzt…
Buy@Generic.Abilify.Without.Prescription” rel=”nofollow”>..…
Buynow it tly…
Buy@Generic.Acai” rel=”nofollow”>.…
Buygeneric drugs mby…
Cheap@Generic.Acai” rel=”nofollow”>……
Buydrugs without prescription vrg…
Order@Cheap.Energy.Boost” rel=”nofollow”>..…
Buyno prescription wkp…
Order@Discount.Energy.Boost” rel=”nofollow”>..…
Buyno prescription gdt…
Order@Cheap.Aciphex” rel=”nofollow”>..…
Buydrugs without prescription faj…
Purchase@Discount.Aciphex” rel=”nofollow”>..…
Buyno prescription jui…
Buy@Actonel.Online” rel=”nofollow”>..…
Buydrugs without prescription hak…
Order@Cheap.Actonel” rel=”nofollow”>.…
Buygeneric drugs nih…
Purchase@Actonel.Online” rel=”nofollow”>……
Buygeneric drugs vbr…
Purchase@Cheap.Actonel” rel=”nofollow”>.…
Buydrugs without prescription xab…
Order@Discount.Advair” rel=”nofollow”>..…
Buyno prescription tao…
Get@Aggrenox.Online” rel=”nofollow”>……
Buynow fjl…
Order@Cheap.Albenza” rel=”nofollow”>……
Buynow it sxk…
risperdal@vs.abilify” rel=”nofollow”>.…
Buygeneric drugs…
allegra@generic.purchase” rel=”nofollow”>……
Buynow…
……
Search music now US Charts…
sleep aids and half-life…
Buy_it now…
adhd drugs causing hallucinations…
Buy_generic meds…
number of obese in this generation…
Buy_generic meds…
aspirin pain relief dog…
Buy_drugs without prescription…
drug alcohol prevention resilience…
Buy_it now…
research being done to treat hiv…
Buy_generic pills…
serotonin natural sources…
Buy_generic meds…
nursing drug study website…
Buy_drugs without prescription…
planar warts…
Buy_drugs without prescription…
stop smoking phlegm…
Buy_drugs without prescription…
what foods anorexia eat…
Buy_drugs without prescription…
nexium pepsin ac…
Buy_generic drugs…