using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace OTSIncAReportApp._1_UI.Control_Grids { public partial class SpectrumExportConfirmation : Form { bool m_SpectrumConfirmation = false; string m_savepath = ""; public bool SpectrumConfirmation { get { return m_SpectrumConfirmation; } set { m_SpectrumConfirmation = value; } } public string FileName { get { return m_savepath; } set { m_savepath = value; } } public SpectrumExportConfirmation() { InitializeComponent(); } private void bt_Path_Click(object sender, EventArgs e) { //将所有的数据导出到EXCEL中 SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Excel File(*.xlsx)|*.xlsx"; //设置默认文件类型显示顺序 sfd.FilterIndex = 1; sfd.FileName = "ParticlesInfo"; //保存对话框是否记忆上次打开的目录 sfd.RestoreDirectory = true; if (sfd.ShowDialog() == DialogResult.OK) { tBox1.Text = sfd.FileName; } } private void cB_SpectrumConfirmation_CheckedChanged(object sender, EventArgs e) { if(cB_SpectrumConfirmation.Checked) { m_SpectrumConfirmation = true; } else { m_SpectrumConfirmation = false; } } private void bt_Export_Click(object sender, EventArgs e) { if(tBox1.Text == "") { MessageBox.Show("save path can not be null!"); } else { m_savepath = tBox1.Text; this.DialogResult = DialogResult.OK; this.Close(); } } } }