using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Judge.Commons; using Core.StlMes.Client.Judge.Controls; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Windows.Forms; namespace Core.StlMes.Client.Judge.Forms { public partial class RolledTubePhyPassApplyFrm : FrmBase { private QcmBcPhyJudgeCtrl _zgPhyJudgeCtrl; private QcmZcCheckconsignGroupCtrl _zcCheckconsignGroupCtrl; private QcmZgChemPhyCtrl _zgChemPhyCtrl; private Dal _d; public RolledTubePhyPassApplyFrm() { InitializeComponent(); IsLoadUserView = true; this.isLoadStlye = true; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (_zgChemPhyCtrl == null) return; _zgChemPhyCtrl.JhyPhyResultCtrl.UltraGrid1.DisplayLayout.Override.SupportDataErrorInfo = SupportDataErrorInfo.RowsAndCells; foreach (var tab in _zgChemPhyCtrl.UltraTabControl2.Tabs) { if (tab.Key == "002001007010") { QcmJhyElementsCtrl jhyElementsCtrl = (QcmJhyElementsCtrl)((SplitContainer)tab.TabPage.Controls[0]).Panel2.Controls[0]; jhyElementsCtrl.UltraGrid1.DisplayLayout.Override.SupportDataErrorInfo = SupportDataErrorInfo.RowsAndCells; } else if (tab.Key == "002001007020" || tab.Key == "002001007013" || tab.Key == "002001007015" || tab.Key == "002001007014" || tab.Key == "002001007009") { QcmJhyPhyResultCtrl jhyPhyResultCtrl = (QcmJhyPhyResultCtrl)((SplitContainer)tab.TabPage.Controls[0]).Panel2.Controls[0]; jhyPhyResultCtrl.UltraGrid1.DisplayLayout.Override.SupportDataErrorInfo = SupportDataErrorInfo.RowsAndCells; } } } private string _processCode = ""; private void RolledTubeChemJudgeFrm_Load(object sender, EventArgs e) { _processCode = CustomInfo.Substring(0, 1); _zgPhyJudgeCtrl = new QcmBcPhyJudgeCtrl(panel2, ob); _zgPhyJudgeCtrl.UltraGrid1.AfterRowActivate += lgChemJudgeCtrl_AfterRowActivate; _zgPhyJudgeCtrl.BringToFront(); _zgPhyJudgeCtrl.UltraGrid1.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False; dataTable1.Clear(); dataTable1.Rows.Add("00", "编制中"); dataTable1.Rows.Add("10", "已下发"); dataTable1.Rows.Add("20", "生产中"); dataTable1.Rows.Add("30", "已生产"); dataTable1.Rows.Add("40", "关闭"); _zcCheckconsignGroupCtrl = new QcmZcCheckconsignGroupCtrl(splitContainer1.Panel1, ob, JudgeType.RolledTubePhy,UserInfo); _zcCheckconsignGroupCtrl.UltraGrid1.AfterRowActivate += zcCheckconsignGroupCtrl_AfterRowActivate; if (_processCode != "F") { _zcCheckconsignGroupCtrl.UltraGrid1.DisplayLayout.Bands[0].Columns["lotNoGroup"].Hidden = true; } //_jhyPhySplineCtrl = new QcmJhyPhySplineCtrl(ultraTabPageControl3, ob); //_jhyPhySplineCtrl.UltraGrid1.AfterRowActivate += jhyPhySplineCtrl_AfterRowActivate; _zgChemPhyCtrl = new QcmZgChemPhyCtrl(ultraExpandableGroupBoxPanel2, ob, false, "phy", _processCode); _d = new Dal(ob); //labelDateTimePicker1.Checked = true; labelDateTimePicker1.Value = DateTime.Now.Date.AddDays(-3); labelDateTimePicker2.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1); labelDateTimePicker5.Value = DateTime.Now.Date.AddDays(0).AddSeconds(1); labelDateTimePicker6.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1); checkBox3.Checked = true; dateTimePicker1.Value = DateTime.Now.Date.AddDays(-3); dateTimePicker2.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1); labelDateTimePicker4.Checked = true; labelDateTimePicker4.Value = DateTime.Now.Date.AddDays(-3); labelDateTimePicker3.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1); JudgeBaseInfo.LoadPlineName(ultraComboEditor2, ob, true, "A"); ClsBaseInfo.FillComBaseInfo(labelComboBox1.ComboBox, "407407", ob, false); //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格 DataTable dt = (DataTable)labelComboBox1.ComboBox.DataSource; DataRow dr = dt.NewRow(); dr["BASECODE"] = "1"; dr["BASENAME"] = "已判"; dt.Rows.InsertAt(dr, 0); dr = dt.NewRow(); dr["BASECODE"] = "0"; dr["BASENAME"] = "未判"; dt.Rows.InsertAt(dr, 0); dt.AcceptChanges(); dt.DefaultView.RowFilter = "BASECODE IN ('0', '1')"; labelComboBox1.Checked = true; labelComboBox1.ComboBox.SelectedIndex = 0; //ClsBaseInfo.SetComboItemHeight(labelComboBox1.ComboBox); ClsBaseInfo.FillComBaseInfo(labelComboBox3.ComboBox, "407407", ob, false); DataTable dtCmb3 = (DataTable)labelComboBox3.ComboBox.DataSource; dtCmb3.DefaultView.RowFilter = "BASECODE IN ('40740701', '40740704')"; JudgeBaseInfo.LoadPlineName(labelComboBox2.ComboBox, ob, false, _processCode); labelComboBox2.ComboBox.DropDownListWidth = -1; string[] datePurviewIds = this.ValidDataPurviewIds; if (CustomInfo.Contains("WG")) { datePurviewIds = new string[] { "002001001001" };//计划科 } DataTable dtPline = _d.GetTableByXmlId("JdgComBasePline.getPlineByDept", new object[] { datePurviewIds }); DataTable cmb2Dt = (DataTable)labelComboBox2.ComboBox.DataSource; for (int i = cmb2Dt.Rows.Count - 1; i >= 0; i--) { if (dtPline.Select("plinecode = '" + cmb2Dt.Rows[i]["plinecode"].ToString() + "'").Length == 0) { cmb2Dt.Rows[i].Delete(); } } foreach (var item in labelComboBox2.ComboBox.Items) { item.CheckState = CheckState.Checked; } JudgeBaseInfo.LoadPlineName(labelComboBox4.ComboBox, ob, false, _processCode); labelComboBox2.Checked = true; labelComboBox4.ComboBox.DropDownListWidth = -1; DataTable cmb4Dt = (DataTable)labelComboBox4.ComboBox.DataSource; for (int i = cmb4Dt.Rows.Count - 1; i >= 0; i--) { if (dtPline.Select("plinecode = '" + cmb4Dt.Rows[i]["plinecode"].ToString() + "'").Length == 0) { cmb4Dt.Rows[i].Delete(); } } foreach (var item in labelComboBox4.ComboBox.Items) { item.CheckState = CheckState.Checked; } labelComboBox4.Checked = true; labelComboBox5.Checked = true; labelComboBox5.ComboBox.SelectedIndex = 2; //BindPhyItem(); } private string _ordLnPk = ""; void zcCheckconsignGroupCtrl_AfterRowActivate(object sender, EventArgs e) { if (_zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow == null) return; string steelStandard = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow.GetValue("steelStandrad"); try { this.Cursor = Cursors.WaitCursor; var groupRow = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow; DataTable dtConsign = _d.GetTableByXmlId("JdgQcmZcCheckconsign.queryAllByCheckNo", groupRow.GetValue("checkNo")); DataRow drPlnSaleOrd = _d.GetRowByXmlId("JdgPlnSaleOrd.getOrdLnPkByDlyPk", dtConsign.Rows[0]["ordLnDlyPk"].ToString()); if (drPlnSaleOrd == null) return; string ordLnPk = drPlnSaleOrd["ordLnPk"].ToString(); _ordLnPk = ordLnPk; _zgChemPhyCtrl.Query(_zgChemPhyCtrl.GetParm(dtConsign, null, null, "", true)); } finally { this.Cursor = Cursors.Default; } } void meltingStoveNoCtrl_Click(object sender, EventArgs e) { //string stoveNo = _meltingStoveNoCtrl.UltraGrid1.GetActiveRowValue("StoveNo"); //_stlIncisionCtrl.Query(stoveNo); } public override void ToolBar_Click(object sender, string ToolbarKey) { base.ToolBar_Click(sender, ToolbarKey); switch (ToolbarKey) { case "Query": Query(); break; case "PassApply": PassApply(); break; case "Export": GridHelper.ulGridToExcel(_zgPhyJudgeCtrl.UltraGrid1, "预判定记录"); break; case "FoldQuery": FoldQuery(); break; case "Close": this.Close(); break; } } public void PassApply() { if (_zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow == null) { MessageUtil.ShowWarning("没有需要放行申请的记录!"); return; } if (_zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.ActiveRow == null) { MessageUtil.ShowWarning("没有需要放行申请的记录!"); return; } string checkNo = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow.GetValue("checkNo"); var chkRows = _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True"); if (chkRows.Count() == 0) { if (_zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.ActiveRow == null) { MessageUtil.ShowWarning("请选择申请判定记录!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1); } else { MessageUtil.ShowWarning("请选择申请判定记录!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1, _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.ActiveRow.Cells["Chk"]); } return; } List parms = new List(); string judgeStoveNo = ""; string batchNo = ""; String processCode = CustomInfo; foreach (var row in chkRows) { judgeStoveNo = row.GetValue("judgeStoveNo"); batchNo = row.GetValue("batchNo"); DataRow drZgJudgeApply = _d.GetRowByXmlId("JdgQcmBcPassApplyDAL.QueryDetailIsPass", checkNo, row.GetValue("sampleNo"), row.GetValue("phyCodeMin"), row.GetValue("batchNo")); if (drZgJudgeApply["jfResult"].ToString() != "0" && drZgJudgeApply["nkResult"].ToString() != "0") { MessageUtil.ShowWarning("只有判定不合格的记录,才能申请质量放行!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1, row); return; } //DataRow drPassApply = _d.GetRowByXmlId("JdgQcmBcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"), // row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), processCode); //if (drPassApply != null) //{ // MessageUtil.ShowWarning("该记录已生成放行申请单,不能重复生成!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1, row); // return; //} string[] parm = new string[] { checkNo, row.GetValue("sampleNo"), row.GetValue("phyCodeMin"), row.GetValue("batchNo") }; parms.Add(parm); } PopupSubmit popupSubmit = new PopupSubmit("是否确认放行申请?", true, "请输入放行申请原因!"); if (popupSubmit.ShowDialog() != System.Windows.Forms.DialogResult.Yes) { return; } var ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligatePassApply.passApply", parms, processCode, UserInfo.GetUserName(), UserInfo.GetDeptid(), UserInfo.GetDepartment(), popupSubmit.TxtAudit.Text.Trim()); if (ccp.ReturnInfo != "") { MessageUtil.ShowError(ccp.ReturnInfo); return; } else { MessageUtil.ShowTips("操作成功!"); } UltraGridRow checkGroupRow = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow; Relocate(checkNo); } private void Query() { try { this.Cursor = Cursors.WaitCursor; string judgeTimeB = labelDateTimePicker1.Checked ? labelDateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; string judgeTimeE = labelDateTimePicker1.Checked ? labelDateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; string judgeTimeStart = labelDateTimePicker5.Checked ? labelDateTimePicker5.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; string judgeTimeEnd = labelDateTimePicker5.Checked ? labelDateTimePicker6.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; string judgeState = labelComboBox1.Checked ? labelComboBox1.ComboBox.Value.ToString2() : ""; string lotNo = labelTextBox1.Checked ? labelTextBox1.Text.Trim() : ""; string judgeStoveNo = labelTextBox4.Checked ? labelTextBox4.Text.Trim() : ""; string[] plines; if (!labelComboBox2.Checked) { plines = new string[labelComboBox2.ComboBox.Items.Count]; for (int i = 0; i < labelComboBox2.ComboBox.Items.Count; i++) { plines[i] = labelComboBox2.ComboBox.Items[i].DataValue.ToString2(); } if (plines.Length == 0) { plines = new string[] { "1" }; } } else if (labelComboBox2.ComboBox.Value == null) { plines = new string[] { "1" }; } else { plines = ((List)labelComboBox2.ComboBox.Value).Select(a => a.ToString()).ToArray(); } string chemType = ultraOptionSet2.Value.ToString(); string gpSource = ultraOptionSet3.Value.ToString2(); string checkNo = labelTextBox5.Checked ? labelTextBox5.Text.Trim() : ""; string isCheck = labelComboBox5.Checked ? labelComboBox5.SelecteValue.ToString2() : ""; switch (ultraTabControl1.SelectedTab.Text) { case "理化判定": _zgChemPhyCtrl.ClearData(true); _zcCheckconsignGroupCtrl.Query(lotNo, judgeStoveNo, judgeState, judgeTimeB, judgeTimeE, plines, chemType, gpSource, _processCode, checkNo, isCheck, judgeTimeStart, judgeTimeEnd); break; case "判定记录": string batchNo2 = labelTextBox3.Checked ? labelTextBox3.Text.Trim() : ""; string judgeStoveNo2 = labelTextBox2.Checked ? labelTextBox2.Text.Trim() : ""; string judgeResult = labelComboBox3.Checked ? labelComboBox3.SelecteValue.ToString2() : ""; string judgeTimeB2 = labelDateTimePicker4.Checked ? labelDateTimePicker4.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; string judgeTimeE2 = labelDateTimePicker4.Checked ? labelDateTimePicker3.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; string[] plines2; if (!labelComboBox4.Checked) { plines2 = new string[labelComboBox4.ComboBox.Items.Count]; for (int i = 0; i < labelComboBox4.ComboBox.Items.Count; i++) { plines2[i] = labelComboBox4.ComboBox.Items[i].DataValue.ToString2(); } if (plines2.Length == 0) { plines2 = new string[] { "1" }; } } else if (labelComboBox4.ComboBox.Value == null) { plines2 = new string[] { "1" }; } else { plines2 = ((List)labelComboBox4.ComboBox.Value).Select(a => a.ToString()).ToArray(); } QueryJudgeRecord(judgeStoveNo2, batchNo2, judgeTimeB2, judgeTimeE2, judgeResult, plines2); break; } } finally { this.Cursor = Cursors.Default; } } private void Relocate(string checkNo) { _zcCheckconsignGroupCtrl.UltraGrid1.BeginUpdate(); Query(); var reGroupRow = _zcCheckconsignGroupCtrl.UltraGrid1.Rows.Where(a => a.GetValue("checkNo") == checkNo).FirstOrDefault(); if (reGroupRow != null) { reGroupRow.Activate(); } _zcCheckconsignGroupCtrl.UltraGrid1.EndUpdate(); } private void labelDateTimePicker1_CheckBox_CheckedChanged(object sender, EventArgs e) { labelDateTimePicker2.DateTimeEnabled = labelDateTimePicker1.Checked; } private void QueryJudgeRecord(string judgeStoveNo, string batchNo, string judgeTimeB, string judgeTimeE, string judgeResult, string[] plines) { _zgPhyJudgeCtrl.Query(judgeStoveNo, batchNo, judgeResult, judgeTimeB, judgeTimeE, plines, _processCode); } private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { //PlnOrderZgFrm plnOrderZgFrm = new PlnOrderZgFrm(ultraTextEditor1.Text.Trim(), ob); //if (plnOrderZgFrm.ShowDialog() == System.Windows.Forms.DialogResult.OK) //{ // ultraTextEditor1.Text = plnOrderZgFrm.ActiveProOrderNo; //} } private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { try { this.Cursor = Cursors.WaitCursor; string[] values; if (ultraComboEditor1.Value == null || !checkBox1.Checked) { values = new string[0]; } else { values = ((List)ultraComboEditor1.Value).Select(a => a.ToString()).ToArray(); } //_jhyPhyResultCtrl.ClearData(); string stoveNo = ultraTextEditor2.Text.Trim(); string plineCode = checkBox2.Checked ? ultraComboEditor2.Value.ToString2() : ""; string judgeState = ultraOptionSet1.Value.ToString2(); string timeB = checkBox3.Checked ? dateTimePicker1.Value.ToString("yyy-MM-dd HH:mm:ss") : ""; string timeE = checkBox3.Checked ? dateTimePicker2.Value.ToString("yyy-MM-dd HH:mm:ss") : ""; } finally { this.Cursor = Cursors.Default; } } private void labelDateTimePicker4_CheckBox_CheckedChanged(object sender, EventArgs e) { labelDateTimePicker3.DateTimeEnabled = labelDateTimePicker4.Checked; } void lgChemJudgeCtrl_AfterRowActivate(object sender, EventArgs e) { } private void checkBox1_CheckedChanged(object sender, EventArgs e) { ultraComboEditor1.Enabled = checkBox1.Checked; } private void checkBox3_CheckedChanged(object sender, EventArgs e) { dateTimePicker2.Enabled = dateTimePicker1.Enabled = checkBox3.Checked; } private void checkBox2_CheckedChanged(object sender, EventArgs e) { ultraComboEditor2.Enabled = checkBox2.Checked; } private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (toolMenu == null || toolMenu.Toolbars.Count == 0) return; if (ultraTabControl1.ActiveTab.Index == 0) { if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = true; if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = true; if (this.toolMenu.Toolbars[0].Tools.Exists("Delete")) this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Visible = true; if (this.toolMenu.Toolbars[0].Tools.Exists("CyCles")) this.toolMenu.Toolbars[0].Tools["CyCles"].SharedProps.Visible = true; if (this.toolMenu.Toolbars[0].Tools.Exists("CancelCyCles")) this.toolMenu.Toolbars[0].Tools["CancelCyCles"].SharedProps.Visible = true; if (this.toolMenu.Toolbars[0].Tools.Exists("ApplyResample")) this.toolMenu.Toolbars[0].Tools["ApplyResample"].SharedProps.Visible = true; if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteResample")) this.toolMenu.Toolbars[0].Tools["DeleteResample"].SharedProps.Visible = true; if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = false; } else if (ultraTabControl1.ActiveTab.Index == 1) { if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = false; if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = false; if (this.toolMenu.Toolbars[0].Tools.Exists("Delete")) this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Visible = false; if (this.toolMenu.Toolbars[0].Tools.Exists("CyCles")) this.toolMenu.Toolbars[0].Tools["CyCles"].SharedProps.Visible = false; if (this.toolMenu.Toolbars[0].Tools.Exists("CancelCyCles")) this.toolMenu.Toolbars[0].Tools["CancelCyCles"].SharedProps.Visible = false; if (this.toolMenu.Toolbars[0].Tools.Exists("ApplyResample")) this.toolMenu.Toolbars[0].Tools["ApplyResample"].SharedProps.Visible = false; if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteResample")) this.toolMenu.Toolbars[0].Tools["DeleteResample"].SharedProps.Visible = false; if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true; } } finally { this.Cursor = Cursors.Default; } } private void ultraTabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (_zcCheckconsignGroupCtrl == null || _zcCheckconsignGroupCtrl.UltraGrid1 == null || _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow == null) return; var groupRow = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow; DataTable consign = _d.GetTableByXmlId("JdgQcmZcCheckconsign.queryAllByCheckNo", groupRow.GetValue("checkNo")); string craftSource = consign.Rows[0]["craftSource"].ToString(); _zgChemPhyCtrl.Query(_zgChemPhyCtrl.GetParm(consign, null, null, "", true)); } finally { this.Cursor = Cursors.Default; } } private void labelTextBox4_TextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { Query(); } } private void ultraTextEditor2_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { ultraTextEditor2_EditorButtonClick(null, null); } } private void labelTextBox2_TextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { Query(); } } private void ultraExpandableGroupBox2_ExpandedStateChanged(object sender, EventArgs e) { if (!ultraExpandableGroupBox2.Expanded) { ultraExpandableGroupBox2.Dock = DockStyle.Bottom; splitContainer1.Panel1.Controls.Add(ultraExpandableGroupBox2); ultraExpandableGroupBox2.BringToFront(); splitContainer1.Panel2Collapsed = true; } else { ultraExpandableGroupBox2.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(ultraExpandableGroupBox2); splitContainer1.Panel2Collapsed = false; } } private void RolledTubePhyJudgeFrm_Shown(object sender, EventArgs e) { ultraTabControl1_SelectedTabChanged(null, null); FoldQuery(); } private void FoldQuery() { if (!this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) return; panel1.Visible = !panel1.Visible; if (panel1.Visible) { this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "折叠查询区域"; //this.splitContainer1.SplitterDistance += 67; } else { this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "展开查询区域"; //this.splitContainer1.SplitterDistance -= 67; } } } }