Click here to Skip to main content
15,885,910 members
Articles / Programming Languages / C# 4.0

restrict a form to not open more then one at time

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
16 Jan 2013CPOL 0  
There are many approaches you could use. Singleton form is only one of them, but an elegant one: http://hashfactor.wordpress.com/2009/03/31/c-winforms-create-a-single-instance-form/[^][update]using System;using System.Collections.Generic;using System.Drawing;using...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
2 Jan 2013Muhamad Faizan Khan 2 alternatives  
how to restrict a form to not open more then one at time..showDialogue method i know but tell me another way.my code behind the buttonform_2search sw=new form_2search();sw.show();sw.ismdiparent=this;
Please Sign up or sign in to vote.
20 Jan 2013milenalukic
Hi,Try this:Form myform = null;form_2search myform=null;List frms = Application.OpenForms.OfType().ToList(); foreach (Form f in frms) { string type = f.Name.ToString(); if (type == "FormWebCam") { myform =...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
Hungary Hungary
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions