Exemple #1
0
        public ChildForm(Form child, SnapSides side, FormSnap instance)
        {
            this.Instance              = instance;
            this._Side                 = side;
            this.ChildFrm              = child;
            this.ChildDontDoNextEvent  = false;
            this.ParentDontDoNextEvent = false;

            this.Side = side;
        }
Exemple #2
0
    public FormSnap(Form Parent, Form Child, SnapSides side)
    {
        this.ParentForm = Parent;
        //this.ChildForm = Child;
        //this._SnappedSide = side;

        this.ParentForm.LocationChanged += new EventHandler(this.ParentForm_LocationChanged);
        this.ParentForm.SizeChanged     += new EventHandler(this.ParentForm_SizeChanged);
        this.ParentForm.Show();

        this.InitChildForm(new ChildForm(Child, side, this));
    }
Exemple #3
0
    public void Add(Form Child, SnapSides ChildSnapSide)
    {
        foreach (ChildForm frm in this.ChildForms)
        {
            if (frm.Side == ChildSnapSide)
            {
                throw new Exception("Already have another child for snapped to this side!");
            }
            if (frm.ChildFrm == Child)
            {
                throw new Exception("Already have the same child for snapped!");
            }
        }

        ChildForm f = new ChildForm(Child, ChildSnapSide, this);

        this.InitChildForm(f);
    }