1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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.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();
- }
-
- }
- }
- }
|