lundi 24 juillet 2017

how to check if a Windows.Form is empty but not null?

I have a function which returns an instance of Windows Form

   `public Form getForm(string Node)
   {
   Form obj = new Form();

   obj = (Form)Activator.CreateInstance(Node);
   return obj;
   }`

I am Calling this function as :

   Form requestedForm = new Form(); 
   requestedForm = getForm(system);
   if ((requestedForm != null) && (requestedForm.Text!=""))
   // to check if the Form is not empty.
   {
    openform(requestedForm);
   }        
   else
   {
    MessageBox.Show("No form Found");
   }        

In Some Cases i get requestedForm.Text="" even if the form is not blank so how do i check this ?

Any help would be deeply appreciated





Aucun commentaire:

Enregistrer un commentaire