Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
| Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 11th, 2007, 10:06 AM
Authorized User
 
Join Date: Nov 2006
Location: New Delhi, Delhi, India.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Get Name of opened Forms

Hi
I have one mdiForm and one ChildForm. mdiForm has one menu named mnu1. When I click on mnu1 ChildForm Opens. But when i again click on mnu1 next ChildForm also Opens. But I want when One Form was opened then 2nd Same Form doesn't allow to open().
Give me some Idea.
How to restrict a Form to Open when it is already Opened.

Thanks and Regards
Kumar Ashish
9350789189
__________________
Thanks
Kumar Ashish
krashishroa@yahoo.co.in
 
Old January 17th, 2007, 03:17 PM
Friend of Wrox
 
Join Date: Dec 2006
Location: , , .
Posts: 176
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
you can use the boolean variable

if you dont understand it tell me to write the code for you

enjoy it
kiani mehdi
 
Old January 17th, 2007, 11:35 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

pls send me the code

 
Old January 18th, 2007, 03:40 AM
Friend of Wrox
 
Join Date: Dec 2006
Location: , , .
Posts: 176
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

in the main form class ((Form1)) declare

public static bool exist =false;

on menu click event type the following code

if(!exist)
{

Form2 newFrm =new Form2();
newFrm.ShowDialog();
exist=True;

}


on Form2 on FormClosing Event type the following code

Form1.exist=false;




best regards
kiani mehdi
 
Old January 22nd, 2007, 08:05 AM
Friend of Wrox
 
Join Date: May 2006
Location: Delhi, Delhi, India.
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this on ParentForm.....
this.ActiveMDIChildForm.Hide();


Bijgupt




Similar Threads
Thread Thread Starter Forum Replies Last Post
error : [server has not yet been opened] - HELP ME declovey Pro VB 6 3 February 10th, 2007 05:02 AM
Server has not yet been opened Fernando Cisternas Crystal Reports 0 January 13th, 2006 05:12 PM
Sever has not yet been opened ravee789 Crystal Reports 2 October 20th, 2003 06:56 AM
Server not yet opened sathishraj Crystal Reports 1 October 15th, 2003 08:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.