madhuri Gamane

madhuri Gamane

  • NA
  • 105
  • 33.4k

how to pass form as a variable to function

Jul 2 2015 7:11 AM
hello ..
i have a question ..
i am having mdi parent and at least 50 child forms in my application
now when create a function by passing "frmuser" as  user it gives me error..
but i want these all lines in a function, olz help me...
 
 if (Application.OpenForms.OfType<frmUser>().Count() >= 1)     
       {        
      Application.OpenForms.OfType<frmUser>().First().Activate();  
           }        
     else   
          {        
         frmUser u = new frmUser();     
            u.MdiParent = this;       
          u.Show();       
      }

Answers (1)