public void LinkPageForm(object tTag) { try { Assembly aAssembly = Assembly.GetEntryAssembly(); string strPath = aAssembly.GetName().ToString(); string strForm = strPath.Substring(0, strPath.IndexOf(",")) + "." + LinkPage.Trim(); Type tType = aAssembly.GetType(strForm); Form frm = ((Form)Activator.CreateInstance(tType)); frm.Tag = tTag; frm.ShowDialog(); } catch (Exception eException) { System.Windows.Forms.MessageBox.Show(eException.Message); } }
public Form LinkPageForm() { try { Assembly aAssembly = Assembly.GetEntryAssembly(); string strPath = aAssembly.GetName().ToString(); string strForm = strPath.Substring(0, strPath.IndexOf(",")) + "." + LinkPage.Trim(); Type tType = aAssembly.GetType(strForm); return((Form)Activator.CreateInstance(tType)); } catch (Exception eException) { System.Windows.Forms.MessageBox.Show(eException.Message); return(null); } }