LockIcon.cs 1.0 KB

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