UControl_CutHole.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace HOZProject
  11. {
  12. public partial class UControl_CutHole : UserControl
  13. {
  14. private string cutHoleName;
  15. public string CutHoleName { get => cutHoleName; set => cutHoleName = value; }
  16. private int cutHoleState;
  17. public int CutHoleState { get => cutHoleState; set => cutHoleState = value; }
  18. private FormHOZMain formHOZMain;
  19. public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
  20. public UControl_CutHole(FormHOZMain formHOZ)
  21. {
  22. InitializeComponent();
  23. FormHOZMainObject = formHOZ;
  24. }
  25. private void UContrl_CutHole_Load(object sender, EventArgs e)
  26. {
  27. btnCutHole.Text = CutHoleName;
  28. }
  29. private void tsShowProcess_Click(object sender, EventArgs e)
  30. {
  31. ClearProcessControls();
  32. //显示检测过程信息
  33. UControl_Process uControl_Process = new UControl_Process(FormHOZMainObject);
  34. //UCTimeLine uControl_Process = new UCTimeLine();
  35. FormHOZMainObject.plProcess.Width = uControl_Process.Width;
  36. FormHOZMainObject.plProcess.Height = uControl_Process.Height;
  37. if ((this.Location.Y + uControl_Process.Height) > FormHOZMainObject.Height)
  38. {
  39. uControl_Process.Location = new Point(this.Left, this.Bottom- this.Top);
  40. }
  41. else
  42. {
  43. uControl_Process.Location = new Point(this.Location.X, this.Location.Y);
  44. }
  45. uControl_Process.Dock = DockStyle.Fill;
  46. FormHOZMainObject.plProcess.Location = uControl_Process.Location;
  47. FormHOZMainObject.plProcess.Controls.Add(uControl_Process);
  48. FormHOZMainObject.plProcess.Visible = true;
  49. }
  50. private void tsShowParaInfo_Click(object sender, EventArgs e)
  51. {
  52. ClearProcessControls();
  53. //显示切入点参数信息
  54. UControl_ParaInfo uControl_ParaInfo = new UControl_ParaInfo(FormHOZMainObject);
  55. //UCTimeLine uControl_Process = new UCTimeLine();
  56. FormHOZMainObject.plProcess.Width = uControl_ParaInfo.Width;
  57. FormHOZMainObject.plProcess.Height = uControl_ParaInfo.Height;
  58. if ((this.Location.Y + uControl_ParaInfo.Height) > FormHOZMainObject.Height)
  59. {
  60. uControl_ParaInfo.Location = new Point(this.Left, this.Bottom - this.Top);
  61. }
  62. else
  63. {
  64. uControl_ParaInfo.Location = new Point(this.Location.X, this.Location.Y);
  65. }
  66. uControl_ParaInfo.Dock = DockStyle.Fill;
  67. FormHOZMainObject.plProcess.Location = uControl_ParaInfo.Location;
  68. FormHOZMainObject.plProcess.Controls.Add(uControl_ParaInfo);
  69. FormHOZMainObject.plProcess.Visible = true;
  70. }
  71. private void ClearProcessControls()
  72. {
  73. //清空处理层中的控件
  74. FormHOZMainObject.plProcess.Controls.Clear();
  75. }
  76. }
  77. }