Help in calling form
-
Friends I want to do the following things in a function. Forms.frmFIR fr = new uHTMCM.Forms.frmFIR(); fr.show(); where frmFIR is the form name and uHTMCM is the namespace of the project. what I want is to send the form name and namespace name in that function(suppose the function name is frmshow(takes two parameter)) and do the above two lines in that function. Can any1 help???
-
Friends I want to do the following things in a function. Forms.frmFIR fr = new uHTMCM.Forms.frmFIR(); fr.show(); where frmFIR is the form name and uHTMCM is the namespace of the project. what I want is to send the form name and namespace name in that function(suppose the function name is frmshow(takes two parameter)) and do the above two lines in that function. Can any1 help???
Saiyed Alam, You dont need to pass anything to the constructor, just add the below lines in the frmFIR, they will give you the details you want.
Class name: System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name;
Namespace name: System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Namespace;Regards, Gareth. (FKA gareth111)
-
Friends I want to do the following things in a function. Forms.frmFIR fr = new uHTMCM.Forms.frmFIR(); fr.show(); where frmFIR is the form name and uHTMCM is the namespace of the project. what I want is to send the form name and namespace name in that function(suppose the function name is frmshow(takes two parameter)) and do the above two lines in that function. Can any1 help???
a) if the form is in the same assembly of your method Assembly asm = Assembly.GetExecutingAssembly(); Form frmTemp = asm.CreateInstance(Your_Namespace + "." + Your_Form_Name); frmTemp.Show(); b) if the form to be called in from some other assembly Assembly asm = Assembly.LoadFrom(AssemblyPath); Form frmTemp = asm.CreateInstance(Your_Namespace + "." + Your_Form_Name); frmTemp.Show(); Hope this helps
-
Friends I want to do the following things in a function. Forms.frmFIR fr = new uHTMCM.Forms.frmFIR(); fr.show(); where frmFIR is the form name and uHTMCM is the namespace of the project. what I want is to send the form name and namespace name in that function(suppose the function name is frmshow(takes two parameter)) and do the above two lines in that function. Can any1 help???