using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using MeasureData; namespace HOZProject { public partial class UControl_CutHole : UserControl { private string cutHoleName; public string CutHoleName { get => cutHoleName; set => cutHoleName = value; } private string cutHoleCode; public string CutHoleCode { get => cutHoleCode; set => cutHoleCode = value; } private int cutHoleState; public int CutHoleState { get => cutHoleState; set => cutHoleState = value; } private FormHOZMain formHOZMain; public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; } private UControl_ParaInfo uControl_ParaInfo; public UControl_ParaInfo UControl_ParaInfo { get => uControl_ParaInfo; set => uControl_ParaInfo = value; } public UControl_CutHole(FormHOZMain formHOZ) { InitializeComponent(); FormHOZMainObject = formHOZ; } private void UContrl_CutHole_Load(object sender, EventArgs e) { btnCutHole.Text = CutHoleName; } private void tsShowProcess_Click(object sender, EventArgs e) { //ClearProcessControls(); //显示检测过程信息 UControl_Process uControl_Process = new UControl_Process(FormHOZMainObject); FormHOZMainObject.plPrarInfo.Width = uControl_Process.Width; FormHOZMainObject.plPrarInfo.Height = uControl_Process.Height; uControl_Process.Dock = DockStyle.Fill; FormHOZMainObject.plPrarInfo.Location = uControl_Process.Location; FormHOZMainObject.plPrarInfo.Controls.Add(uControl_Process); FormHOZMainObject.plPrarInfo.Visible = true; } private void tsShowParaInfo_Click(object sender, EventArgs e) { //显示处理信息 ShowParaControl(UControl_ParaInfo.Name); FormHOZMainObject.plPrarInfo.Visible = true; } /// /// 向主界面中的属性层中,添加切孔信息用户控件 /// /// private void AddParaControl(UControl_ParaInfo uControl_ParaInfo) { bool isExist = false; if (FormHOZMainObject.plPrarInfo.Controls.Count == 0) { FormHOZMainObject.plPrarInfo.Controls.Add(uControl_ParaInfo); isExist = true; } else { foreach (Control item in FormHOZMainObject.plPrarInfo.Controls) { if (item is UserControl) { if (item.Name == uControl_ParaInfo.Name) { isExist = true; break; } } } } if (!isExist) { FormHOZMainObject.plPrarInfo.Controls.Add(uControl_ParaInfo); } } private void ShowParaControl(string cutHoleName) { foreach (Control item in FormHOZMainObject.plPrarInfo.Controls) { if (item is UserControl) { if (item.Name == cutHoleName) { item.Visible = true; } else { item.Visible = false; } } } } } }