private void button_ok_Click(object sender, EventArgs e) { //if (textBox_selectUploadPath.Text.Trim() == "") //{ // MessageBox.Show("結果文件存儲(上傳)路徑為空,請選擇存儲文件夾!"); // this.DialogResult = System.Windows.Forms.DialogResult.None; // return; //} if (textBox_selectBackUpPath.Text.Trim() == "") { MessageBox.Show("結果文件備份路徑為空,請選擇備份存儲文件夾!"); this.DialogResult = System.Windows.Forms.DialogResult.None; return; } if (checkBox_savepics.Checked && textBox_picssavepath.Text.Trim() == "") { MessageBox.Show("請選擇拍照圖片存儲路徑(已經選中需要保存圖片)"); this.DialogResult = System.Windows.Forms.DialogResult.None; return; } if (checkBox_saveDecodeFailPics.Checked && textBox_decodeFailPicsSavePath.Text.Trim() == "") { MessageBox.Show("請選擇解析失敗圖片存儲路徑(已經選中需要保存解析NG圖片)"); this.DialogResult = System.Windows.Forms.DialogResult.None; return; } if (textBox_SpecialPath.Text.Trim() == "") { // MessageBox.Show("特殊配置文件路徑為空,請選擇特殊配置存儲文件夾!"); // this.DialogResult = System.Windows.Forms.DialogResult.None; return; } else { GlobalVar.gl_SpecialPath = textBox_SpecialPath.Text; string iniFilePath = GlobalVar.gl_strTargetPath + "\\" + GlobalVar.gl_iniTBS_FileName; myfunc.CheckFileExit(); MyFunctions.WritePrivateProfileString(GlobalVar.gl_inisection_Global, GlobalVar.gl_inikey_specialPath, GlobalVar.gl_SpecialPath, iniFilePath); //特殊路径 } }
public ChooseLineName() { InitializeComponent(); ChooseLineNameInit();//获取开放线别 DBQuery db = new DBQuery(); db.GetLineListInfo(); tableLayoutPanel1.Controls.OfType <RadioButton>();//只查找RadioButton控件 StringBuilder str_tmp = new StringBuilder(50); string iniFilePath = GlobalVar.gl_strTargetPath + "\\" + GlobalVar.gl_iniTBS_FileName; MyFunctions.GetPrivateProfileString(GlobalVar.gl_inisection_Global, GlobalVar.gl_inikey_Line, "", str_tmp, 50, iniFilePath); //读取产线 GlobalVar.gl_LineName = str_tmp.ToString().Trim(); foreach (RadioButton bt in tableLayoutPanel1.Controls.OfType <RadioButton>()) { bt.Anchor = AnchorStyles.None; bt.AutoSize = false; if (GlobalVar.gl_LineName != "NONET" && GlobalVar.gl_LineName != "") { switch (GlobalVar.gl_LineName.Substring(1, 1)) { case "1": if (bt.Name == "rdb_OLine" + GlobalVar.gl_LineName.Substring(GlobalVar.gl_LineName.Length - 1, 1)) { ((RadioButton)bt).Checked = true; } break; case "2": if (bt.Name == "rdb_SLine" + GlobalVar.gl_LineName.Substring(GlobalVar.gl_LineName.Length - 1, 1)) { ((RadioButton)bt).Checked = true; } break; case "3": if (bt.Name == "rdb_TLine" + GlobalVar.gl_LineName.Substring(GlobalVar.gl_LineName.Length - 1, 1)) { ((RadioButton)bt).Checked = true; } break; case "4": if (bt.Name == "rdb_FLine" + GlobalVar.gl_LineName.Substring(GlobalVar.gl_LineName.Length - 1, 1)) { ((RadioButton)bt).Checked = true; } break; default: break; } } //bt.CheckAlign = System.Drawing.ContentAlignment.TopRight; //bt.Size = new System.Drawing.Size(100, 50); //bt.Font = new Font("宋体", 9, FontStyle.Bold); } }