private void 新窗口打开绘图NToolStripMenuItem_Click(object sender, EventArgs e) { try { CommonChartForm form = new CommonChartForm(); form.Text = this.Text; form.Init(this.chart1.Series); form.Show(); }catch (Exception ex) { Geo.Utils.FormUtil.ShowErrorMessageBox(ex.Message + " 只能新打开一次!"); } }
private void button_openNewTableWihFormat_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = Setting.TextTableFileFilter; openFileDialog.Multiselect = true; CheckOrInitOption(); if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string[] files = openFileDialog.FileNames; foreach (var filePath in files) { var reader = new ObjectTableReader(filePath, Encoding.Default); var table = reader.Read();//.GetDataTable(); var fileName = System.IO.Path.GetFileName(filePath); var colNames = table.ParamNames.ToArray(); foreach (var item in colNames) { if (!Option.SeriesSettingOptions.ContainsKey(item)) { table.RemoveCol(item); } } if (table.ColCount == 0 || table.RowCount == 0) { Geo.Utils.FormUtil.ShowWarningMessageBox("载入表格格式不匹配!" + filePath); continue; } var form = new CommonChartForm(table) { Text = fileName }; form.Text = filePath; form.Option = this.Option; form.Option.ApplyOptionFormat(chart1); form.Show(); // form.Show(); } } }