//------------------------------------------------------------------------------ // Explicit Activation // This entry point is used to activate the application explicitly //------------------------------------------------------------------------------ public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here int module_id; theUfSession.UF.AskApplicationModule(out module_id); if (module_id != UFConstants.UF_APP_DRAFTING) { MessageBox.Show("請先轉換為製圖模組後再執行!"); } else { Application.EnableVisualStyles(); PartInformationDlg cPartInformationDlg = new PartInformationDlg(); List <Control> listControl = new List <Control>(); foreach (Control i in cPartInformationDlg.Controls) { listControl.Add(i); Functions.GetAllControl(i, ref listControl); } foreach (Control c in listControl) { c.Font = new Font(c.Font.Name, 9); } FormUtilities.ReparentForm(cPartInformationDlg); System.Windows.Forms.Application.Run(cPartInformationDlg); cPartInformationDlg.Dispose(); } theProgram.Dispose(); } catch (NXOpen.NXException ex) { // ---- Enter your exception handling code here ----- } return(retValue); }
//------------------------------------------------------------------------------ // Explicit Activation // This entry point is used to activate the application explicitly //------------------------------------------------------------------------------ public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); Application.EnableVisualStyles(); PartInformationDlg cPartInformationDlg = new PartInformationDlg(); FormUtilities.ReparentForm(cPartInformationDlg); System.Windows.Forms.Application.Run(cPartInformationDlg); cPartInformationDlg.Dispose(); theProgram.Dispose(); } catch (NXOpen.NXException ex) { // ---- Enter your exception handling code here ----- } return(retValue); }