private void btn_savePath_Click(object sender, EventArgs e)
        {
            UtilClass.FolderBrowserDialog dlg = new UtilClass.FolderBrowserDialog();

            DialogResult dr = dlg.ShowDialog(this);

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                filePath = dlg.DirectoryPath;
                textEdit_file.EditValue = filePath;
            }
        }
Example #2
0
        private void btn_open_Click(object sender, EventArgs e)
        {
            UtilClass.FolderBrowserDialog dlg = new UtilClass.FolderBrowserDialog();

            DialogResult dr = dlg.ShowDialog(this);

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                filePath = dlg.DirectoryPath;
                textEdit_file.EditValue = filePath;
            }

            workbook = new Workbook();

            workbook.CreateNewDocument();

            workbook.SaveDocument(textEdit_file.EditValue.ToString() + @"\aa.xlsx");

            textEdit_fileName.EditValue = "main_sheet";

            isFirstLoad = false;
            //string fileName;

            //SaveFileDialog saveFileDialog = new SaveFileDialog();
            //saveFileDialog.Filter = "excel2003文件|*.xls|excel文件|*.xlsx";
            //saveFileDialog.RestoreDirectory = true;
            //saveFileDialog.FilterIndex = 2;
            //if (saveFileDialog.ShowDialog() == DialogResult.OK)
            //{
            //    docPath = fileName = saveFileDialog.FileName;

            //    textEdit_file.EditValue = fileName;

            //    workbook = new Workbook();

            //    workbook.CreateNewDocument();

            //    workbook.SaveDocument(textEdit_file.EditValue.ToString());

            //    textEdit_fileName.EditValue = "main_sheet";

            //    isFirstLoad = false;
            //}
        }