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; }
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)); }
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); }