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_IfExportSpectrumConfirmation = false; bool m_IfExportSpectrumData = false; bool m_IfExportPicture = false; string m_savepath = ""; public bool IfExportSpectrumConfirmation { get { return m_IfExportSpectrumConfirmation; } set { m_IfExportSpectrumConfirmation = value; } } public bool IfExportSpectrumData { get { return m_IfExportSpectrumData; } set { m_IfExportSpectrumData = value; } } public bool IfExportPicture { get { return m_IfExportPicture; } set { m_IfExportPicture = 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_IfExportSpectrumConfirmation = true; } else { m_IfExportSpectrumConfirmation = 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; } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { } private void cB_SpectrumData_CheckedChanged(object sender, EventArgs e) { if (cB_SpectrumData.Checked) { m_IfExportSpectrumData = true; } else { m_IfExportSpectrumData = false; } } private void cB_Picture_CheckedChanged(object sender, EventArgs e) { if (cB_Picture.Checked) { m_IfExportPicture = true; } else { m_IfExportPicture = false; } } } }