private void MainForm_Load(object sender, EventArgs e) { //不知道为什么,这里如果不加 try 块的话,有些异常无法捕捉得到,导致软件 “毫无征兆” 地关闭或没有现象。 try { mgr = UIDataManager.GetInstance(); mgr.OnNewWinLogAdded += Mgr_OnNewWinLogAdded; mgr.StartRepeatGetNewData(); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } this.txtNewestPeriod.Text = mgr.CurrentSelectedNewestPeriod.ToString(); this.txtDingMaCount.Text = mgr.CurrentSelectedDingMaCount.ToString(); InitialDataGridView(); this.rbFirstTwo.Checked = mgr.CurrentSelectedForecastType == ForecastType.FirstTwo; this.rbLastTwo.Checked = !this.rbFirstTwo.Checked; }