Hi!
 
       Try this code.
 
private void menuItem2_Click(object sender, System.EventArgs e)
{
foreach(Form f in this.Mdichildren)
{
  if(f.Name==Convert.Tostring(ur MdichildFromName)
     {
    if(f!=this.MdiActivechild)
      {
     f.Close();
      }

}
any doubt mail to me.
 
by,
T.Suresh.
 
 


mona gamal <[EMAIL PROTECTED]> wrote:
hi all
 
I face problem on checking that if ihave a form already opend by using menuitem
I want to stop user from opening this form while it is already opned
 
code written on c#
Main form code

private void menuItem2_Click(object sender, System.EventArgs e)

{

Form2 f=new Form2();

f.MdiParent=this;

f.Show();

}

 

how can i change thios code ;

note:

i made 2 solutions but it dosenot work

first: make flag (true on open(show),false on closed)

second: make menuitem disabled when form already opend & enabled on closed.

 

but these solutions dosenot work

 

i would be gratefull if anyone help me

 

thank you

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Yahoo! India Matrimony: Find your partner now.

YAHOO! GROUPS LINKS




Reply via email to