using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.Windows.Forms; namespace Core.LZMes.Client.UIM.comm { public class CustomPictureBox : PictureBox { private static readonly Image _ImgPltcm = Image.FromFile("./images/OTHER/pltcm.gif"); private static readonly Image _ImgCal = Image.FromFile("./images/OTHER/cal.gif"); private static readonly Image _ImgRcl = Image.FromFile("./images/OTHER/rcl.png"); public CustomPictureBox(Scenes picBoxType, EventHandler onDbClickEvent) { switch (picBoxType.ToString()) { case "PLTCM": this.Name = "pic_PLTCM"; this.Image = _ImgPltcm; this.Height = 70; this.Width = 400; this.Top = 80; this.Left = 50; break; case "CAL": this.Name = "pic_CAL"; this.Image = _ImgCal; this.Height = 77; this.Width = 400; this.Top = 400; this.Left = 570; break; case "RCL": this.Name = "pic_RCL"; this.Image = _ImgRcl; this.Height = 53; this.Width = 250; this.Top = 230; this.Left = 710; break; } switch (picBoxType.ToString()) { case "PLTCM": case "CAL": case "RCL": //显示生产实绩 this.DoubleClick += onDbClickEvent; break; case "STOCK1": case "STOCK2": case "STOCK3": //显示库存数据 break; } this.SizeMode = PictureBoxSizeMode.StretchImage; this.Cursor = Cursors.Hand; } } }