Exemplo n.º 1
0
        private void SetShape(FlatShapeButton button, FlatShapeButton.IconShape shape)
        {
            button.Shape = shape;

            switch (shape)
            {
            case FlatShapeButton.IconShape.Arrow:

                button.ShapeSize = new Size(5, 9);

                break;

            case FlatShapeButton.IconShape.Ellipse:

                button.ShapeSize = new Size(6, 6);

                break;
            }
        }
Exemplo n.º 2
0
            public MinimizedWindow(formDailies owner, Form parent)
            {
                this.owner  = owner;
                this.parent = parent;
                this.Owner  = parent;

                this.FormBorderStyle = FormBorderStyle.None;
                this.BackColor       = Color.White;
                this.ShowInTaskbar   = false;

                var h = this.Handle; //force

                this.Size = new System.Drawing.Size(18, 66);

                this.alignment = owner.alignment;

                buttonMinimize = new FlatShapeButton()
                {
                    ShapeAlignment   = ContentAlignment.MiddleCenter,
                    ShapeDirection   = alignment == HorizontalAlignment.Left ? ArrowDirection.Left : ArrowDirection.Right,
                    Anchor           = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right,
                    Location         = new Point(1, 1),
                    Size             = new Size(this.Width - 2, this.Height - 2),
                    ShapeSize        = new Size(5, 9),
                    BackColorHovered = SystemColors.ControlLight,
                    ForeColor        = SystemColors.GrayText,
                    ForeColorHovered = Util.Color.Darken(SystemColors.GrayText, 0.5f),
                };

                this.Controls.Add(buttonMinimize);

                buttonMinimize.Click      += buttonMinimize_Click;
                buttonMinimize.MouseHover += buttonMinimize_MouseHover;

                parent.LocationChanged += parent_LocationChanged;
                parent.SizeChanged     += parent_SizeChanged;

                owner.VisibleChanged += owner_VisibleChanged;

                PositionToParent();
            }