UControl_ParaInfo.cs 1.2 KB

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