using GrxCAD.EditorInput; 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 HCTools { public partial class TKInfo : Form { public TKInfo() { InitializeComponent(); } #region 图廓信息参数 public static string name = ""; public static string note = ""; public static string CTY = ""; public static string TDY = ""; public static string SHY = ""; public static string JCY = ""; public static string FCY = ""; public static string SV = ""; public static int DH = -1; public static string Secret = ""; public static int BLC = 2000; //public static string ConstLine1 = "GB/T20257.1-2007国家基本比例尺地图图式 第一部分:"; //public static string ConstLine2 = "1:500 1:1000 1:2000地形图图式"; #endregion private void TKInfo_Load(object sender, EventArgs e) { //this.richTextBox1.Text = "\r\n"; //this.richTextBox1.Text += ConstLine1; //this.richTextBox1.Text += "\r\n"; //this.richTextBox1.Text += ConstLine2; //this.richTextBox1.Text += "\r\n"; //this.richTextBox1.Text += System.DateTime.Now.Year + "年" + System.DateTime.Now.Month + "月数字化成图。"; this.textBox_Name.Text = Properties.Settings.Default.TFName; this.richTextBox1.Text = Properties.Settings.Default.Note2; this.textBox_CTY.Text = Properties.Settings.Default.CTY; this.textBox_TDY.Text = Properties.Settings.Default.TDY; this.textBox_SHY.Text = Properties.Settings.Default.SDY; this.textBox_JCY.Text = Properties.Settings.Default.JCY; this.textBox_DH.Text = Properties.Settings.Default.DH.ToString(); this.textBox_secret.Text = Properties.Settings.Default.secret.ToString(); textBox_savepath.Text = Properties.Settings.Default.svpath; } private void btn_OK_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox_Name.Text.Trim()) == true) { MessageBox.Show("请输入图名!", "温磬提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (string.IsNullOrEmpty(comboBox_BLC1.Text)) { MessageBox.Show("请选择比例尺!", "温磬提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if(string.IsNullOrEmpty(textBox_savepath.Text)) { MessageBox.Show("请选择保存路径!", "温磬提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } name = this.textBox_Name.Text; note = this.richTextBox1.Text; CTY = this.textBox_CTY.Text; TDY = this.textBox_TDY.Text; SHY = this.textBox_SHY.Text; JCY = this.textBox_JCY.Text; SV = textBox_savepath.Text; Secret = textBox_secret.Text; if (string.IsNullOrEmpty(textBox_DH.Text.Trim()) == false) { DH = Convert.ToInt32(textBox_DH.Text); } if (comboBox_BLC1.SelectedIndex == 0) { BLC = 500; } else if (comboBox_BLC1.SelectedIndex == 1) { BLC = 1000; } else { BLC = 2000; } //界面最小化 this.Close(); CreateSheetMap map = new CreateSheetMap(); map.create(); Properties.Settings.Default.TFName = name; Properties.Settings.Default.Note2 = note; Properties.Settings.Default.CTY = CTY; Properties.Settings.Default.JCY = JCY; Properties.Settings.Default.TDY = TDY; Properties.Settings.Default.SDY = SHY; Properties.Settings.Default.DH = DH; Properties.Settings.Default.svpath = SV; Properties.Settings.Default.secret = Secret; Properties.Settings.Default.Save(); MessageBox.Show("生成完毕"); } private void btn_Cancel_Click(object sender, EventArgs e) { this.Close(); } private void button_chse_Click(object sender, EventArgs e) { FolderBrowserDialog open = new FolderBrowserDialog(); open.Description = "请选择文件夹"; if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textBox_savepath.Text = open.SelectedPath; } } } }