.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

how can i checked if form is already open in c#

Posted By: Naim Khan     Posted Date: August 25, 2010    Points:2   Category :Windows Application
hello friends,

i want to know that if i have already open form then same form will not open again... is it possible in Windows Application using C#...
and i m using MDI form and other then is Child form.. i m given you code and i dont knowhow can i solve my problem...]

//code for open form
Parties_Entry parties = new Parties_Entry();
parties.MdiParent = Main_Form.mainObj;
parties.Show();
Reply me ASAP...

Responses
Author: Nikhil Kumar             
Posted Date: August 25, 2010     Points: 5   

try this.
frm_emp emp = new frm_emp();
emp.MdiParent = this;
emp.Show();

inform me. if not.


Be helpful and enjoy life because it comes only onces. Give all the happiness to yours and remember it doesn't comes by money ...
Author: Akhil Raj       [Moderator]      
Posted Date: September 05, 2010     Points: 5   
Author: Santosh             
Posted Date: October 06, 2010     Points: 5   

just follow the below link ..

hope u will get ur solution..

http://www.dotnetspark.com/kb/Content.aspx?id=2721



Regards
Santosh

Author: krishana singh             
Posted Date: December 07, 2010     Points: 5   

Form f = this.ActiveMdiChild;
if (f != null)
f.Close();

Author: krishana singh             
Posted Date: December 07, 2010     Points: 5   

//Form f = this.ActiveMdiChild;
//if (f != null)
// f.Close();
//frmAttendance f1 = new frmAttendance();
//f1.MdiParent = this;
//f1.WindowState = FormWindowState.Maximized;
//f1.Show();

Author: Narayanan             
Posted Date: April 11, 2012     Points: 20   

Hi,
try this

 string proc = Process.GetCurrentProcess().ProcessName;
Process[] processes = Process.GetProcessesByName(proc);
if (processes.Length > 1)
{
MessageBox.Show("Already,Application opened", "Application shutdown notification");
Application.Exit();
}


Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend