Ejemplo n.º 1
0
        // Custom constraint is based on form screen size coordinates
        private void SetCustomConstraint()
        {
            Point location   = ActiveForm.PointToScreen(Point.Empty);
            Size  customSize = new Size(ActiveForm.Size.Width - 16, ActiveForm.Size.Height - 36); // apply - 16 to width and -36 to height for hacky(?) offset fix

            Console.WriteLine("Custom location: {0}", location);
            Console.WriteLine("Custom size: {0}", customSize);
            constrainedArea = new Rectangle(location, customSize);
            constraintTypeSetLbl.ForeColor = Color.Green;
            constraintTypeSetLbl.Text      = "custom (according to form size) constraint set!";
        }