Beispiel #1
0
        private void LoadpanelObj___(mobj obj)
        {
            objedit objedit = new objedit();

            try
            {
                objedit.dobj     = obj;
                objedit.Location = new Point(5, 3);
                if (this.tobjs.Count > 0)
                {
                    Point panelLocation = this.tobjs[this.tobjs.Count - 1].GetPanelLocation();
                    panelLocation.X += 40;
                    objedit.Location = panelLocation;
                }
                objedit.Width                 = 0x23;
                objedit.Height                = 0x23;
                objedit.IsMove                = false;
                objedit.BackColor             = (obj.atts[0].zhi[0] == objtype.page) ? Color.FromArgb(0, 0x48, 0x95, 0xfd) : Color.FromArgb(50, 0x48, 0x95, 0xfd);
                objedit.ObjMousedown         += new EventHandler(this.T_objMousedown);
                objedit.ObjXYchang           += new EventHandler(this.T_objXYchang);
                objedit.ObjKeyDown           += new EventHandler(this.T_objKeyDown);
                objedit.Myapp                 = this.Myapp;
                objedit.runscr1               = this;
                objedit.BackgroundImageLayout = ImageLayout.None;
                this.objpanel.Controls.Add(objedit);
                objedit.Chonghuibmp();
                objedit.BringToFront();
                objedit.Visible = true;
                this.allobjedits.Add(objedit);
                if (!this.objpanel.Visible)
                {
                    if (this.objpanel.Height != 60)
                    {
                        this.objpanel.Height = 60;
                    }
                    this.objpanel.Visible = true;
                    if (this.Objpanelresize != null)
                    {
                        this.Objpanelresize(null, null);
                    }
                }
                this.tobjs.Add(objedit);
            }
            catch (Exception exception)
            {
                MessageOpen.Show("加载控件出现错误 ".Language() + exception.Message);
            }
        }
Beispiel #2
0
        private void LoadObj___(mobj obj)
        {
            objedit objedit = new objedit();

            try
            {
                objedit.dobj     = obj;
                objedit.Location = new Point(objedit.dobj.myobj.redian.x, objedit.dobj.myobj.redian.y);
                objedit.Width    = (objedit.dobj.myobj.redian.endx - objedit.dobj.myobj.redian.x) + 1;
                objedit.Height   = (objedit.dobj.myobj.redian.endy - objedit.dobj.myobj.redian.y) + 1;
                objedit.IsMove   = obj.atts[0].zhi[0] != objtype.page;
                if (objedit.Width < 3)
                {
                    objedit.Width = 3;
                }
                if (base.Height < 3)
                {
                    objedit.Height = 3;
                }
                objedit.BackColor     = (obj.atts[0].zhi[0] == objtype.page) ? Color.FromArgb(0, 0x48, 0x95, 0xfd) : Color.FromArgb(50, 0x48, 0x95, 0xfd);
                objedit.ObjMousedown += new EventHandler(this.T_objMousedown);
                objedit.ObjXYchang   += new EventHandler(this.T_objXYchang);
                objedit.ObjKeyDown   += new EventHandler(this.T_objKeyDown);
                objedit.Dragobj      += new EventHandler(this.T_dragobj);
                objedit.Moveobj      += new EventHandler(this.T_moveobj);
                objedit.Myapp         = this.Myapp;
                objedit.runscr1       = this;
                objedit.Visible       = true;
                base.Controls.Add(objedit);
                objedit.BringToFront();
                objedit.Chonghuibmp();
                this.allobjedits.Add(objedit);
            }
            catch (Exception exception)
            {
                MessageOpen.Show("加载控件出现错误 ".Language() + exception.Message);
            }
        }