7f6a1cac4f4bc420d1e4e17cc187704aaa58bce3.svn-base 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7. namespace Core.LZMes.Client.UIM.comm
  8. {
  9. public class CustomPictureBox : PictureBox
  10. {
  11. private static readonly Image _ImgPltcm = Image.FromFile("./images/OTHER/pltcm.gif");
  12. private static readonly Image _ImgCal = Image.FromFile("./images/OTHER/cal.gif");
  13. private static readonly Image _ImgRcl = Image.FromFile("./images/OTHER/rcl.png");
  14. public CustomPictureBox(Scenes picBoxType, EventHandler onDbClickEvent)
  15. {
  16. switch (picBoxType.ToString())
  17. {
  18. case "PLTCM":
  19. this.Name = "pic_PLTCM";
  20. this.Image = _ImgPltcm;
  21. this.Height = 70;
  22. this.Width = 400;
  23. this.Top = 80;
  24. this.Left = 50;
  25. break;
  26. case "CAL":
  27. this.Name = "pic_CAL";
  28. this.Image = _ImgCal;
  29. this.Height = 77;
  30. this.Width = 400;
  31. this.Top = 400;
  32. this.Left = 570;
  33. break;
  34. case "RCL":
  35. this.Name = "pic_RCL";
  36. this.Image = _ImgRcl;
  37. this.Height = 53;
  38. this.Width = 250;
  39. this.Top = 230;
  40. this.Left = 710;
  41. break;
  42. }
  43. switch (picBoxType.ToString())
  44. {
  45. case "PLTCM":
  46. case "CAL":
  47. case "RCL":
  48. //显示生产实绩
  49. this.DoubleClick += onDbClickEvent;
  50. break;
  51. case "STOCK1":
  52. case "STOCK2":
  53. case "STOCK3":
  54. //显示库存数据
  55. break;
  56. }
  57. this.SizeMode = PictureBoxSizeMode.StretchImage;
  58. this.Cursor = Cursors.Hand;
  59. }
  60. }
  61. }