예제 #1
0
        void NewSs(Page item, Sensor s)
        {
            SensorS ss = new SensorS();

            ss.X      = 64;
            ss.Y      = 64;
            ss.Uid    = s.Uid;
            ss.Node   = s.NodeId;
            ss.Port   = s.PortId;
            ss.Sensor = s;
            item.Sensors.Add(ss);
            NewPb(item, ss);
        }
예제 #2
0
        void NewPb(Page item, SensorS ss)
        {
            PicBox pb = new PicBox(ss);

            pb.Cursor   = Cursors.Hand;
            pb.Parent   = this;
            pb.Location = new Point(ss.X, ss.Y);
            item.Pbs.Add(pb);
            pb.DoubleClick += Pb_DoubleClick;
            pb.MouseEnter  += Pb_MouseEnter;
            pb.MouseDown   += Pb_MouseDown;
            pb.MouseUp     += Pb_MouseUp;
            pb.MouseMove   += Pb_MouseMove;
        }
예제 #3
0
 public PicBox(SensorS s)
 {
     this.Size                  = new Size(64, 64);
     this.BackgroundImage       = Image.FromFile("ico.png");//Properties.Resources.ico;//
     this.BackColor             = Color.Transparent;
     this.BackgroundImageLayout = ImageLayout.Stretch;
     this.Ss           = s;
     this.Label        = new Label();
     this.Label.Parent = this;
     this.Label.Text   = s.Node;
     //this.Label.ForeColor = Color.White;
     this.Label.Anchor   = AnchorStyles.Bottom & AnchorStyles.Right;
     this.Label.AutoSize = true;
     this.Label.Location = new Point(this.Width - this.Label.Width - 4, this.Size.Height - this.Label.Height - 5);
     //this.Label.Location = new Point(32, 32);
 }