ClickToCloseForm.cs 810 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace UAS_MES_NEW.CustomControl.BaseForm
  10. {
  11. public partial class ClickToCloseForm : Form
  12. {
  13. String text1;
  14. public ClickToCloseForm(String text)
  15. {
  16. InitializeComponent();
  17. text1 = text;
  18. }
  19. private void ClickToCloseForm_MouseClick(object sender, MouseEventArgs e)
  20. {
  21. // 在鼠标点击事件中关闭窗口
  22. Close();
  23. }
  24. private void ClickToCloseForm_Load(object sender, EventArgs e)
  25. {
  26. MouseClick += ClickToCloseForm_MouseClick;
  27. label1.Text = text1;
  28. }
  29. }
  30. }