LockIcon.cs 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Windows.Forms;
  3. namespace UAS_MES_NEW.CustomControl.ClickPicBox
  4. {
  5. public partial class LockIcon : PictureBox
  6. {
  7. static Control MaCtl;
  8. private bool Locked = false;
  9. public LockIcon()
  10. {
  11. InitializeComponent();
  12. Image = Properties.Resources.lock_open_24px;
  13. }
  14. /// <summary>
  15. /// 获取存放工单的控件
  16. /// </summary>
  17. public static void GetMakeCodeCtl(Control ctl)
  18. {
  19. MaCtl = ctl;
  20. }
  21. private void LockIcon_Click(object sender, EventArgs e)
  22. {
  23. if (Locked)
  24. {
  25. Image = Properties.Resources.lock_open_24px;
  26. Locked = false;
  27. }
  28. else
  29. {
  30. Image = Properties.Resources.lock_lock_24px;
  31. Locked = true;
  32. }
  33. }
  34. }
  35. }