instantiating winform by getting the formname through string??
-
Hello aLL, I am trying to create windows form on the fly by looking at the value coming in form of a string. for example:- i have form by name frmMain i will be getting this name from a string during runtime. I am not getting how to create an instance of an object of type frmMain Thanks in Advance Regards Bharath
Ron
-
Hello aLL, I am trying to create windows form on the fly by looking at the value coming in form of a string. for example:- i have form by name frmMain i will be getting this name from a string during runtime. I am not getting how to create an instance of an object of type frmMain Thanks in Advance Regards Bharath
Ron
Look into
System.Type.GetType ( name )
-
Hello aLL, I am trying to create windows form on the fly by looking at the value coming in form of a string. for example:- i have form by name frmMain i will be getting this name from a string during runtime. I am not getting how to create an instance of an object of type frmMain Thanks in Advance Regards Bharath
Ron
You can achieve this by reflection. Activator.CreateInstance Method[^]
Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion