UControl_Process.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_Process : UserControl
  13. {
  14. private string cutHoleName;
  15. public string CutHoleName { get => cutHoleName; set => cutHoleName = value; }
  16. private FormHOZMain formHOZMain;
  17. public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
  18. public UControl_Process(FormHOZMain formHOZ)
  19. {
  20. InitializeComponent();
  21. FormHOZMainObject = formHOZ;
  22. }
  23. private void btnClose_Click(object sender, EventArgs e)
  24. {
  25. foreach (Control item in FormHOZMainObject.plFill.Controls)
  26. {
  27. if (item is Panel)
  28. {
  29. foreach (Control itemControl in item.Controls)
  30. {
  31. if (itemControl.Name == this.Name)
  32. {
  33. item.Controls.Remove(this);
  34. this.Dispose();
  35. item.Visible = false;
  36. break;
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
  43. }